Path: csiph.com!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch
Newsgroups: comp.lang.c++
Subject: Re: Anyone ever used vector ?
Date: Sun, 15 May 2022 07:48:07 -0700
Organization: A noiseless patient Spider
Lines: 53
Message-ID: <86sfpa3l94.fsf@linuxsc.com>
References: <87sfpn7wz2.fsf@bsb.me.uk> <423b2f62-20d0-4578-a047-a4c2b03d917fn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: reader02.eternal-september.org; posting-host="90fae27f8c3ebf4ec54f5551ea17134b"; logging-data="3392"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18LqQ81Rs47HP2Be8m2waomnu6Rf7Gt6ao="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:CNBNGgPuWV/zUV/0PPY6JXH8STg= sha1:b6bUzRhyqIwlJKAQkZwCVbb9/Gk=
Xref: csiph.com comp.lang.c++:84102
"Alf P. Steinbach" writes:
> On 14 May 2022 05:46, James Kuyper wrote:
>
>> On 5/13/22 12:34, Alf P. Steinbach wrote:
>>
>>> On 13 May 2022 04:53, James Kuyper wrote:
>>
>> ...
>>
>>>> [Correction to my previous post, which I've cancelled - but cancellation
>>>> requests are usually ignored]
>>>> That's covered by the second option. Just because the specification
>>>> allows
>>>> size() to be O(N) doesn't meant that it's required to always involve
>>>> O(N) operations.
>>>
>>> By that logic it can be described as O(n^2 ).
>>
>> You misunderstand. This isn't a description.
>>
>>> And it's within the formal definition of big O notation.
>>>
>>> However, using it that way would be very misleading so it's not done;
>>> there is an understanding that the big O communicates something useful
>>> to know, whereas the way you used it it communicated a falsehood.
>>
>> Since it's not a description, it can't be a false description, either.
>> It's a specification. Standard specifications can neither be false, nor
>> true. A given implementation either meets the specifications, or it
>> doesn't. The specifications might be impossible to meet, but that's a
>> different matter entirely from truth or falsity.
>>
>> Whenever the standard specifies the complexity of an operation, an
>> implementation that has a lower complexity is always allowed. In
>> particular, if the standard specifies O(N), an implementation that
>> sometimes takes O(1) time, and sometimes takes O(N) meets that
>> specification. An implementation that took O(N^2) time would not.
>
> That's a meaningless response.
James's response is not meaningless. It is a bit sloppy in
places in how it uses big-O notation, but it is not meaningless.
If you have trouble understanding what he means I suggest asking
a question.
> I guess by design.
It's hard to see this comment as anything but a gratuitous
insult. Heaven know I don't always agree with what James has to
say, but he is not someone given to making statements that are
deliberately meaningless, and I certainly believe he did not
do so in this instance.