3 ms·
Okay, I understand your take on it. Whether or not my optimization ideas were "fundamental" is up for interpretation. From my point of view I used the word "f
by NathanKP 17y ago
Okay, I understand your take on it.
Whether or not my optimization ideas were "fundamental" is up for interpretation. From my point of view I used the word "fundamental" in that my ideas build upon the basic format and operation of the linked list.
They may not be major but they are enough to make the class considerably faster than STL classes including the deque class.
And if my response to your comment took a pontificate form it was only because I was slightly disappointed that you passed off my idea as a "doubly linked list" when it was actually considerably more than that.
- ismarc 17y agoYou should fix your code for testing the speed of the STL implementation. You intentionally chose to implement it in a scenario that discarded any previous results. The most common usage is for (std::list<x>::iterator it = list.begin(); it != list.end(); it++); Using your naive approach, of course the list is going to be slow to access each element. Keeping a single pointer in memory is much more efficient than spending clock cycles going back over elements you've already seen. If you need the random access, or 32 bits is excessive to keep in memory (for whatever reason), a deque exists specifically for the purpose.