vimwiki/tech/queue.wiki

22 lines
434 B
Plaintext

= Queue =
A literal ordered queue. Keep an order of elements and only push on and remove
from the back
== Good For ==
* Keeping an order of elements
== Bad For ==
* Everything else
== Optimize ==
Only implement this as a linked list, as all insert and removal (which is the
only operation queues have really), will be in O(1) time. Really fast, just no
cache optimizations, but its _usually_ a valid trade-off
[[algorithms]]