Stack - FILO data structure
- could be
implementedwithArrayorLinkedList - use
helper stackto assist getMin, getMax, reverse, swap or replace element - use stack to store the index of the element instead of the element itself
- use queue to implement stack(tmp queue & body queue, offer and poll, swap reference)
Queue - FILO data structure
- could be
implementedwithArrayorLinkedList - store index
- use stack to implement queue, two stack swap reference, push O(n), pop O(1), peek O(1)