Hacker News new | past | comments | ask | show | jobs | submit login

Queues are best implemented with a pow2 cyclic array, and you have a free deque, too.



A 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...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: