4 ms·
Queues are generally implemented with with a vector of pointers to vectors. Nicely diagrammed here https://stackoverflow.com/questions/6292332/what-really-is-a-
by colinmhayes 4y ago
Queues are generally implemented with with a vector of pointers to vectors. Nicely diagrammed here https://stackoverflow.com/questions/6292332/what-really-is-a-deque-in-stl https://stackoverflow.com/questions/6292332/what-really-is-a... Ring buffers also work better than linked lists
- waynesonfire 4y agois Erlang and JDK general enough for you? Oh, both use linked lists, https://github.com/erlang/otp/blob/master/lib/stdlib/src/queue.erl#L55 https://github.com/erlang/otp/blob/master/lib/stdlib/src/que... https://github.com/openjdk-mirror/jdk7u-jdk/blob/master/src/share/classes/java/util/concurrent/LinkedBlockingQueue.java https://github.com/openjdk-mirror/jdk7u-jdk/blob/master/src/...
- xxs 4y agowhy would your refer LinkedBlockingQueue? You have ArrayBlockingQueue, too. ArrayDeque is just better than LinkedList.