8 ms·
Queues are best implemented with a pow2 cyclic array, and you have a free deque, too.
by xxs 4y ago
Queues are best implemented with a pow2 cyclic array, and you have a free deque, too.
- attractivechaos 4y agoA ring-buffer based queue is mostly better than a linked list but it is not necessarily the best. The typical STL deque implementation [1], with all its complexity, is usually faster than a ring buffer. [1] https://stackoverflow.com/questions/6292332/what-really-is-a-deque-in-stl https://stackoverflow.com/questions/6292332/what-really-is-a...