Re: implementation of vector, deque
On 7 ÆÅ×, 08:58, "Alf P. Steinbach" <al...@start.no> wrote:
> At least if "constant time" is interpreted as "amortized constant time",
> as with push_back on a vector (where also the expression "constant time"
> is used).
How can `always takes constant time' in 23.2.1.3 section refer to
amortied cost? :-)
The standard is to write the worst cases. No amortized cost shall be
involved there.
P.S. For example, vector's push_back has amortized constant cost in
most common implementations, though the standard defines it to be no-
worst than linear.
|