Data Structure is a particular arrangement of data used by computer programs to bring efficiency in execution. It can be broadly classified into linear or non-linear data structures.

The linear data structures are those where elements are stored sequentially. The key characteristics of such structures are:

  1. Data elements ordered in a linear fashion.
  2. You can traverse the data in one direction at a single level.
  3. Memory is contagious ( stored as arrays) or dynamic ( like linked-lists).

Common linear data structures are arrays, strings, queues, stack, and linked-lists.

The non-linear structures are those where elements are not stored sequentially, instead form a hierarchy or a network. The non-linear structures have multiple levels.

The key characteristics of non-linear structures are:

  1. Data elements are organized as hierarchy or network.
  2. One can traverse non-linear structures in many ways through their many branches or paths.
  3. They are complex structures.

Common examples of non-linear structures are trees, graphs, heap, etc.

Classic Data Structures
image source - Data Structures Using C By R. Krishnamoorthy
Classic Data Structures
image source – Data Structures Using C
By R. Krishnamoorthy