stack-and-queue
Using a Linked List as the underlying data storage mechanism, implement both a Stack and a Queue
whiteboard
Approach & Efficiency
Stack:
peek() is O(1)
pop() is O(1)
push() is O(1)
isEmpty() is O(1)
Queue:
enqueue() is O(n)
dequeue() is O(1)
peek() is O(1)
isEmpty() is O(1)