• Home
  • What are the 5 key data structures?

What are the 5 key data structures?

There are generally considered to be five key data structures in computer science:

  1. Arrays: A contiguous block of memory that stores a fixed number of elements of the same data type.
  2. 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.
  3. 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.
  4. 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.
  5. 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.