Ad Code

6/recent/ticker-posts

Types of Data Structure

Data Structure Types

A data structure is the organization of the data in a way so that it can be used efficiently. There are two types of data structures,

  1. Linear Data structure
  2. Non linear data structure 

 Lets understand each type one by one with examples

Linear Data Structure

A data structure us a linear when all elements are arranged in a sequential order or in linear order.
Each data structure must have one predecessor and one successor 
Examples,



Stack
Linked List



Queue

 
Array 
                




Non Linear Data Structure

A data structure is non linear when all the elements are not arranged in a linear order. In this type data structure, there is no linear arrangements of elements.
Examples,
 
Tree

Graph




In further classifications of data structures , there are again two types which are static data structure and Dynamic data structure.

Static Data Structure

The data structure in which memory is allocated at compile time is known as static data structure. In this the maximum size is fixed. Using these type of data structures we can access elements very fast. But there is one drawback, the speed of insertion and deletion of elements is slow.
Example :- array
                                                                               

Dynamic Data Structure

The data structure in which memory is allocated at run time is known as static data structure. In this we can change the maximum size. Using these type of data structures we can easily  insert or delete elements within less time. Again there one drawback of this data structure that the time for accessing elements is more than the time needed for access in static data structure.
Example:- Linked list


Post a Comment

0 Comments

Ad Code