Stack

A stack is a linear abstract data type which operates in LIFO (last in first out) order. Because it is an abstract data type, it can be implemented under the hood with arrays, linked-list or other more concrete data structures. Linked lists are a common choice because in a linked list the necessary operations are O(1) (constant time).

Operations