Login  Register

Re: AW: Problem with a list of times

Posted by Luigi Ballabio-2 on Oct 02, 2002; 6:08am
URL: http://quantlib.414.s1.nabble.com/Problem-with-a-list-of-times-tp2221p2224.html

At 01:44 PM 10/2/02 +0200, Jens Thiel wrote:
>it's not a bad implementation in the STL, but a bad choice of the programmer
>;-)   list, deque, vector, ... have all different strengths and weaknesses.

Just to complete the review: a deque has random access like vector, but
differs in the fact that deque is optimized for adding and removing items
at either end (adding and removing in the middle is expensive, like for
vector.)

Also as a partial excuse for Francesco, the C++ standard says in clause
25.3.1.1 that sort() has complexity N log N, which is the same as std::sort
(clause 25.3.1.1). Were this satisfied by his STL implementation, list
would have been a good choice for sequential insertion + sorting...

Bye,
         Luigi