Skip to main content


What is Data Structure?

Data Structure (DS) is a way to store and organize data so that it can be used efficiently.
The C programming language has many data structures like an array, stack, queue, link list , tree etc. A programmer selects an appropriate Data Structure and uses it according to their convenience.

Introduction: 

Data Structure can be defined as a group of data elements which provides an efficient way of storing and organize data in the computer so that it can be use efficiently. Some example of data structures are,

  • array
  • link list
  • stack
  • queue
Why we use Data structures ?

as application are getting complex and amount of data is increasing bay by day , there may arise the following problems :
  • Processor Speed : To handle very large amount of data, high speed processing is required, but as the data is growing day by day to the billion of files per entity, processor may be fail to deal with that much amount of data.
  • Data Speed : Consider an inventory size of 106 items in a store, if our application needs to search for a particular item, it needs to traverse 106 items every time, result in slowing down the search process.
  • Multiple Requests : If thousands of users are searching the data simultaneously on a web server, then there are the changes that a very large server can be failed during that process. 
In order to solve above problems , Data Structures are used. Data is organized to form a data structure in such a way that all item are not required to be searched and required data can be searched instantly.


What is the advantages of Data Structures ?

Efficiency : Efficiency of a program depends upon the choice of data structures. For example: Suppose , we have some data and we need to perform the search for a particular record. In that case, If we organize our data in array, we will have to search sequentially element by element. hence, using array may not be very efficient here. There are better data structure which can make the search process efficient like ordered array , binary search tree or hash tables.

Re-usability : Data structure are reusable, i.e. once we have implemented a particular Data Structure, we can use it at any other place. Implementation of Data Structures can be compiled into libraries which can be used by different clients.

Abstraction : Data Structure is specifies by ADT which provides a level of abstraction. The client program uses the Data Structure through interface only, which out getting the implementation details.

Classification of Data Structures :

There are two types of Data Structures ,

  1. Primitive Data Structure
  2. Non-Primitive Data Structure
The Non-Primitive Data Structures are divided into two parts :
  1. Linear Data Structure
  2. Non-Linear Data Structure

The Linear Data Structures are divided into two parts :

  1. Static (For example : Array)
  2. Dynamic (For example : Link List, Stack, Queue)
The Non-Linear Data Structure are divided into two parts:
  1. Tree
  2. Graph
The Block Diagram of Classification of Data Structure


Linear Data Structures : A data structure is called linear if all of its elements are arranged in the linear order. In Linear Data Structures, the elements are stored in non-hierarchical way where each elements has the successors and predecessors except the first and last element.

types of Linear Data Structures:

Array : An array is a collection of similar types of data items and each item is called an element of array. The data types of the element may be any valid data types like char , int, float, or double.

The elements of array share the same variable name but each one carries a different index number known as subscript. The array can be one dimensional or two dimensional or multidimensional.


Link List : Link List is a linear data structures which is used to maintain a list in the memory. it can be seen as the collection of nodes stored at non-contiguous memory locations. Each node of the list contains a pointer to its adjacent node.

Stack : Stack is a linear list in which insertion and deletions are allowed only one end, called top.
A stack is an abstract data type, can be implemented in most of the programming languages. It is named as stack because it behaves like a real-world stack, for example : piles of plates or deck of cards etc.

Queue : Queue is a linear list in which elements can be inserted only at one end called rear and deleted only at the other end called front.
It is an abstract data Structure , similar to stack. Queue is opened at both end therefore it follows First_in-First-Out(FIFO) methodology for storing the data items.

Non-Linear Data Structures :

This Data Structures does not form a sequence . i.e. each item or element is connected with two or more other items in a non-linear arrangement. The data Element are not arranged in sequential structure.

Trees : Trees are multilevel data structures with a hierarchical relationship among its elements known as nodes. The bottom most nodes in the hierarchy are called Leaf node while the topmost node is called root node. Each node contains pointer to point adjacent nodes.

Trees data structure based on the parent-child relationship among the nodes. each node in the tree can have more than one children except the leaf nodes whereas each node can have at most one parent except the root node. Trees can be classified into many categories.

Graphs : Graphs can be defined as pictorial representation of set of elements connected by the links knows as edges. A graph is different from tree in the sense that a graph can have cycle while the tree can not have the one.

Comments