There are generally considered to be five key data structures in computer science:
- Arrays: A contiguous block of memory that stores a fixed number of elements of the same data type.
- Linked lists: A linear data structure that consists of a set of nodes, where each node contains a value and a reference to the next node.
- Stacks: A linear data structure that follows the last-in, first-out (LIFO) principle, where the most recently added element is the first to be removed.
- Queues: A linear data structure that follows the first-in, first-out (FIFO) principle, where the first element added is the first to be removed.
- Trees: A non-linear data structure that consists of a set of nodes organized into a hierarchy, with a root node at the top and child nodes below.