Linear Data Structures


A Data Structure is said to be linear if its elements form a sequence or a linear list. There are two ways of representing linear data structures in memory. One way is to have the linear relationship between the elements by means of sequential memory locations. Such linear structures are Arrays. The other way is to have the linear relationship between the elements representing by means of links. such linear data structures are called Linked List.

Examples:

  • Arrays
  • Linked Lists
  • Stacks
  • Queues

Stacks and Queues are implemented using Arrays and Lists

Arrays Representation

  • Value1
  • Value2
Arrays are Homogenous and Static type (allocations of memory is done at the beginning)

Linked List representation

  • Value | NextNode
  • Value | NextNode
NextNode will store address of a next connected node. Linked Lists are HetroGenous and Dynamic type (allocation of memory is done at run time)

Homogenous (Arrays) : The data structures which contains single type of data either Integer or Strings or Other
HetroGenous (Lists) : The Data Structure which contains multiple types of data like Interger ,Strings, Floats