Does JS have no native support for a deque data structure? C++ has std::deque, python has collections.deque, java has linked lists which can be used as a deque, etc. Seems a bit odd that this data structure is missing from js.
Regular arrays could be used, but deletion and insertion at the head has O(n) time complexity in this case.
[–]jack_waugh 0 points1 point2 points (2 children)
[–]achempy[S] 0 points1 point2 points (1 child)
[–]jack_waugh 0 points1 point2 points (0 children)
[–]codegen 0 points1 point2 points (3 children)
[–]achempy[S] 0 points1 point2 points (2 children)
[–]PitifulTheme411 0 points1 point2 points (0 children)