A few algorithms and data structures implemented in Javascript.
A stack interface for the using JS array methods
A traditional implementation of an automatically expanding array based list with O(1) insertion and deletion at one end (LIFO).
A traditional implementation of an automatically expanding array based list with O(1) insertion and deletion in the same order they were added (FIFO).
A list implementation with fast insertion and deletion at both ends (enqueue, dequeue, push, and pop).
An implicit head implemented using an array and Eytzinger's Method.
-
Cormen, Leiserson, Rivest, Stein. Introduction to Algorithms (2nd ed.) Exercise 2.2-2, pp.29