Instagram
youtube
Facebook
Twitter

Linear and Non-Linear Data Structures

Linear Data Structure

  • A Linear data structure has data elements arranged in a sequential manner and each member element is connected to its previous and next element. Examples: Linked List, Stack, Queue, Array.
  • We can traverse all the elements in a single run and linear data structures are easy to implement because the computer's memory is arranged in a linear way. 

Non-Linear Data Structure

  • Data structures where data elements are not arranged sequentially or linearly are called non-linear data structures. In a non-linear data structure, a single level is not involved. Examples: Tree, BST, Graph.
  • We can't traverse all elements in a single run.
  • Nonlinear data structures are not easy to implement as compared to linear data structure though, it utilizes computer memory efficiently. 

Note:

Before proceeding further in this course let's understand or revise the data types in python. So, it'd be more comfortable for you to understand data structures.

Python Data Types {Comprehensive Overview}