Stack
Definition
LIFO data structure with two main operations push (adds element in stack) and pop (pops element on top of the stack).
Implementation
Dynamic array or linked list.
Complexity
Queue
Operation | Complexity |
---|---|
Push | |
Pop |
Append and deletion of last element complexities are constant time for both the linked list and the dynamic array.