Data Structures
Content
1. Data Structure
2. Linear Data Structure
3. Array
4. Linked List
5. Stack
6. Queue
7. Non-Linear Data Structure
8. Tree
9. Graph
Data Structure
A way of organizing data in computer memory so it that can be used effectively. The
idea is to reduce time and space complexities of different operations.
Data Structure Hierarchy
Linear Data Structure
List of Linear Data Structures
Array
Array is data structure used to store homogeneous
elements at the contiguous locations
Linked List
A linked list is sequence of elements and each element
is separate object consist of 2 items data and reference
to next node.
Stack
A stack is an abstract data type with principle of LIFO
(last in , first out).
Queue
A queue is another ADS with principle of FIFO (first
in, first out).
Arrays
Array is collection of items stored at a contiguous locations. The idea is to store
multiple items of same type together.
List of Basic Operations on Array
Insertion O(n)
Adding an element at give index.
Deletion O(n)
Remove the element at given index.
Search O(n) or Sorted Array O(log n)
Searches an element using given value.
Traverse O(n)
Fetch each element one by one.
Access O(1)
Get an element value of at given index.
Linked List
Linked List is a sequence of nodes which contains items. Each node contains data
and link to next node.
Types of Linked List
Simple Linked List
Every node in list store next node link and last node
has NULL as link.
Doubly Linked List
Every node in list has 2 links one to the next node
and other to the previous node.
Circular Linked List
It is similar to simple linked list, except last node
link reference to first node.
Linked List (cont.)
List of Basic Operations on Linked List
Insertion O(1)
New Node can added as first, or at after current
reference or as last Node.
Deletion O(1)
Existing Node can deleted as first, or after current
reference or as last Node.
Search O(n)
Searches an element using given value.
Access O(n)
To get an element has to traverse from head node.
Head => 1 => 3 => NULL
Head => 0 => 1 => 3 => NULL
Head => 0 => 1 => 2 => 3 => NULL
Head => 0 => 1 => 2 => 3 => 4 => NULL
Head => A => B => C => D => E => NULL
Head => B => C => D => E => NULL
Head => B => D => E => NULL
Head => B => D => NULL
Stack
A Stack is Abstract Data Type (ADT) like real-world stack allows operations at one
end only or it is called as Last-In-First-Out (LIFO).
List of Basic Operations on Stack
Push O(1)
Adding an element at top of the stack.
Pop O(1)
Remove the element from top of the stack.
Access O(n)
Element can be access using top pointer.
Queue
A Queue is Abstract Data Type (ADT) like real-world queue allows operations at two
end or it is called as First-In-First-Out (FIFO).
List of Basic Operations on Queue
Enqueue O(1)
Adding an element at rear or end of the queue.
Dequeue O(1)
Remove the element from front of the queue.
Access O(n)
An element can be access in queue using front
or rear pointer.
Non-Linear Data Structure
It is a data structure in which a data element is connected to several other data
elements.
List of Non-Linear Data Structures
Tree
It is a hierarchical data structure
Graph
It is pervasive data structure
Tree
Type of Trees data structure
Binary Tree
It is a tree in which each node has at most 2 children
Binary Search Tree
It is similar to BT, but left child always less than parent and
right is always greater than parent
Red Black Tree
It is self-balancing BST where each node has an extra bit to
represent color.
AVL Tree
It is self-balancing BST where height of left and right
subtrees cannot be more than one.
Binary Heap
It is complete tree, with heap ordering property i.e. Root
node value is either Max or Min of its children.
Tree is a Abstract Data type (ADT), that simulates a hierarchical tree structure with root
value and subtrees of children with a parent node, represented as a set of linked node.
Binary Search Tree (BST)
BST, is a tree in which each node has at most 2 children and left child node key
always less than parent node and right child key is always greater than parent node
List of Basic Operations on BST
1. Insertion O(h*)
Adding an element in tree.
2. Deletion O(h*)
Remove the element from tree.
3. Search O(h*)
Search an element in a tree.
Traversal Order
1. Pre-order : Root => Left => Right
2. In-order : Left => Root => Right
3. Post-order : Left => Right => Root
4. Level-order: Level 0 => Level 1 => …Level n
* Height of the tree
Graph
A Graph is a non-linear data structure group of vertices and edges, where edges are used
to connect vertices. It can be seen as a cyclic tree, where the vertices(Node) maintain
complex relationship among them instead of having parent child relationship.
Graph (cont.)
1. Undirected Graph
(a) An undirected graph G having five vertices and seven edges. (b) An adjacency-list representation of G.
(c) The adjacency-matrix representationof G.
2. Directed Graph
(a) A directed graph G having six vertices and eight edges. (b) An adjacency-list representation of G.
(c) The adjacency-matrix representation of G.
Graph (cont.)
Depth First Search (DFS) Breadth First Search (BFS)
Graph Traversal
Questions?

More Related Content

PPTX
Data Structure & Algorithms | Computer Science
PPTX
Introduction of Data Structure
PPTX
DATA STRUCTURE
PPT
Introduction to data structure by anil dutt
PPTX
DATA STRUCTURE IN C LANGUAGE
PDF
Data Structures
PPTX
Data structure,abstraction,abstract data type,static and dynamic,time and spa...
PDF
Introduction to data structure
Data Structure & Algorithms | Computer Science
Introduction of Data Structure
DATA STRUCTURE
Introduction to data structure by anil dutt
DATA STRUCTURE IN C LANGUAGE
Data Structures
Data structure,abstraction,abstract data type,static and dynamic,time and spa...
Introduction to data structure

What's hot (20)

PPTX
Introduction to data structure ppt
PDF
Data Structures Notes 2021
PPTX
Data Structures
PPT
1.1 binary tree
PPTX
Data structure & its types
PDF
Data structures (introduction)
PPT
Introductiont To Aray,Tree,Stack, Queue
PDF
Data Structure Basics
PDF
Data structure using c++
PPTX
Data structure & algorithms introduction
PPTX
Introduction to data structure
PDF
Ii pu cs practical viva voce questions
PPT
Introduction to data structure
PPTX
Introduction To Data Structures.
PPTX
Presentation on Data Structure
PPT
Trees - Data structures in C/Java
PDF
Data structures
PPTX
Data structure and its types
PPTX
Introduction to data structure
PPTX
Tree - Data Structure
Introduction to data structure ppt
Data Structures Notes 2021
Data Structures
1.1 binary tree
Data structure & its types
Data structures (introduction)
Introductiont To Aray,Tree,Stack, Queue
Data Structure Basics
Data structure using c++
Data structure & algorithms introduction
Introduction to data structure
Ii pu cs practical viva voce questions
Introduction to data structure
Introduction To Data Structures.
Presentation on Data Structure
Trees - Data structures in C/Java
Data structures
Data structure and its types
Introduction to data structure
Tree - Data Structure
Ad

Similar to Data Structures (20)

PDF
Introduction to Data Structure
PPTX
DATA STRUCTURE INTRODUCITON FULL NOTES.pptx
PPTX
data structures and algorithms Unit 1
PPTX
General Data structures
PPT
LINKEDb2bb22bb3b3b3b3n3_LIST_UKL_1-2.ppt
PPTX
Data Structures & Algorithms Unit 1.pptx
PPT
Fundamentals of data structures
PPTX
Advanced Data Structures and Algorithms.pptx
PPT
Operations on linked list
DOCX
Data structures notes
PPTX
1.3 Linked List.pptx
PPTX
Data Structure
PPTX
DSL Unit 4 (Linked list) (PPT)SE3rd sem sppu.pptx
PDF
data structure and algorithm note for IT students
PDF
Linked list (introduction) 1
PPTX
UNIT 2 TREES & GRAPH COMPLETE NOTES OF DATA STRUCTURE
PPT
02 linked list_20160217_jintaekseo
PPTX
DATA STRUCTURE AND ALGORITHM with linked list
PPTX
Data Structures Algorithms and Applications
PPTX
Introduction in Data Structure - stack, Queue
Introduction to Data Structure
DATA STRUCTURE INTRODUCITON FULL NOTES.pptx
data structures and algorithms Unit 1
General Data structures
LINKEDb2bb22bb3b3b3b3n3_LIST_UKL_1-2.ppt
Data Structures & Algorithms Unit 1.pptx
Fundamentals of data structures
Advanced Data Structures and Algorithms.pptx
Operations on linked list
Data structures notes
1.3 Linked List.pptx
Data Structure
DSL Unit 4 (Linked list) (PPT)SE3rd sem sppu.pptx
data structure and algorithm note for IT students
Linked list (introduction) 1
UNIT 2 TREES & GRAPH COMPLETE NOTES OF DATA STRUCTURE
02 linked list_20160217_jintaekseo
DATA STRUCTURE AND ALGORITHM with linked list
Data Structures Algorithms and Applications
Introduction in Data Structure - stack, Queue
Ad

More from Rahul Jamwal (6)

PPTX
Process & Mutlithreading
PPTX
Searching & Sorting Algorithms
PPTX
C++ Memory Management
PPTX
Virtual Memory Management
PPTX
C++ shared libraries and loading
PPTX
C++ compilation process
Process & Mutlithreading
Searching & Sorting Algorithms
C++ Memory Management
Virtual Memory Management
C++ shared libraries and loading
C++ compilation process

Recently uploaded (20)

PDF
DNT Brochure 2025 – ISV Solutions @ D365
PDF
BoxLang Dynamic AWS Lambda - Japan Edition
PPTX
Full-Stack Developer Courses That Actually Land You Jobs
PDF
E-Commerce Website Development Companyin india
PDF
How Tridens DevSecOps Ensures Compliance, Security, and Agility
DOCX
How to Use SharePoint as an ISO-Compliant Document Management System
PDF
EaseUS PDF Editor Pro 6.2.0.2 Crack with License Key 2025
PPTX
MLforCyber_MLDataSetsandFeatures_Presentation.pptx
PPTX
Cybersecurity: Protecting the Digital World
PDF
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
PDF
Visual explanation of Dijkstra's Algorithm using Python
PDF
novaPDF Pro 11.9.482 Crack + License Key [Latest 2025]
PDF
CCleaner 6.39.11548 Crack 2025 License Key
DOC
UTEP毕业证学历认证,宾夕法尼亚克拉里恩大学毕业证未毕业
PPTX
Python is a high-level, interpreted programming language
PPTX
most interesting chapter in the world ppt
PPTX
4Seller: The All-in-One Multi-Channel E-Commerce Management Platform for Glob...
PDF
Wondershare Recoverit Full Crack New Version (Latest 2025)
PPTX
Trending Python Topics for Data Visualization in 2025
PPTX
Matchmaking for JVMs: How to Pick the Perfect GC Partner
DNT Brochure 2025 – ISV Solutions @ D365
BoxLang Dynamic AWS Lambda - Japan Edition
Full-Stack Developer Courses That Actually Land You Jobs
E-Commerce Website Development Companyin india
How Tridens DevSecOps Ensures Compliance, Security, and Agility
How to Use SharePoint as an ISO-Compliant Document Management System
EaseUS PDF Editor Pro 6.2.0.2 Crack with License Key 2025
MLforCyber_MLDataSetsandFeatures_Presentation.pptx
Cybersecurity: Protecting the Digital World
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
Visual explanation of Dijkstra's Algorithm using Python
novaPDF Pro 11.9.482 Crack + License Key [Latest 2025]
CCleaner 6.39.11548 Crack 2025 License Key
UTEP毕业证学历认证,宾夕法尼亚克拉里恩大学毕业证未毕业
Python is a high-level, interpreted programming language
most interesting chapter in the world ppt
4Seller: The All-in-One Multi-Channel E-Commerce Management Platform for Glob...
Wondershare Recoverit Full Crack New Version (Latest 2025)
Trending Python Topics for Data Visualization in 2025
Matchmaking for JVMs: How to Pick the Perfect GC Partner

Data Structures

  • 2. Content 1. Data Structure 2. Linear Data Structure 3. Array 4. Linked List 5. Stack 6. Queue 7. Non-Linear Data Structure 8. Tree 9. Graph
  • 3. Data Structure A way of organizing data in computer memory so it that can be used effectively. The idea is to reduce time and space complexities of different operations. Data Structure Hierarchy
  • 4. Linear Data Structure List of Linear Data Structures Array Array is data structure used to store homogeneous elements at the contiguous locations Linked List A linked list is sequence of elements and each element is separate object consist of 2 items data and reference to next node. Stack A stack is an abstract data type with principle of LIFO (last in , first out). Queue A queue is another ADS with principle of FIFO (first in, first out).
  • 5. Arrays Array is collection of items stored at a contiguous locations. The idea is to store multiple items of same type together. List of Basic Operations on Array Insertion O(n) Adding an element at give index. Deletion O(n) Remove the element at given index. Search O(n) or Sorted Array O(log n) Searches an element using given value. Traverse O(n) Fetch each element one by one. Access O(1) Get an element value of at given index.
  • 6. Linked List Linked List is a sequence of nodes which contains items. Each node contains data and link to next node. Types of Linked List Simple Linked List Every node in list store next node link and last node has NULL as link. Doubly Linked List Every node in list has 2 links one to the next node and other to the previous node. Circular Linked List It is similar to simple linked list, except last node link reference to first node.
  • 7. Linked List (cont.) List of Basic Operations on Linked List Insertion O(1) New Node can added as first, or at after current reference or as last Node. Deletion O(1) Existing Node can deleted as first, or after current reference or as last Node. Search O(n) Searches an element using given value. Access O(n) To get an element has to traverse from head node. Head => 1 => 3 => NULL Head => 0 => 1 => 3 => NULL Head => 0 => 1 => 2 => 3 => NULL Head => 0 => 1 => 2 => 3 => 4 => NULL Head => A => B => C => D => E => NULL Head => B => C => D => E => NULL Head => B => D => E => NULL Head => B => D => NULL
  • 8. Stack A Stack is Abstract Data Type (ADT) like real-world stack allows operations at one end only or it is called as Last-In-First-Out (LIFO). List of Basic Operations on Stack Push O(1) Adding an element at top of the stack. Pop O(1) Remove the element from top of the stack. Access O(n) Element can be access using top pointer.
  • 9. Queue A Queue is Abstract Data Type (ADT) like real-world queue allows operations at two end or it is called as First-In-First-Out (FIFO). List of Basic Operations on Queue Enqueue O(1) Adding an element at rear or end of the queue. Dequeue O(1) Remove the element from front of the queue. Access O(n) An element can be access in queue using front or rear pointer.
  • 10. Non-Linear Data Structure It is a data structure in which a data element is connected to several other data elements. List of Non-Linear Data Structures Tree It is a hierarchical data structure Graph It is pervasive data structure
  • 11. Tree Type of Trees data structure Binary Tree It is a tree in which each node has at most 2 children Binary Search Tree It is similar to BT, but left child always less than parent and right is always greater than parent Red Black Tree It is self-balancing BST where each node has an extra bit to represent color. AVL Tree It is self-balancing BST where height of left and right subtrees cannot be more than one. Binary Heap It is complete tree, with heap ordering property i.e. Root node value is either Max or Min of its children. Tree is a Abstract Data type (ADT), that simulates a hierarchical tree structure with root value and subtrees of children with a parent node, represented as a set of linked node.
  • 12. Binary Search Tree (BST) BST, is a tree in which each node has at most 2 children and left child node key always less than parent node and right child key is always greater than parent node List of Basic Operations on BST 1. Insertion O(h*) Adding an element in tree. 2. Deletion O(h*) Remove the element from tree. 3. Search O(h*) Search an element in a tree. Traversal Order 1. Pre-order : Root => Left => Right 2. In-order : Left => Root => Right 3. Post-order : Left => Right => Root 4. Level-order: Level 0 => Level 1 => …Level n * Height of the tree
  • 13. Graph A Graph is a non-linear data structure group of vertices and edges, where edges are used to connect vertices. It can be seen as a cyclic tree, where the vertices(Node) maintain complex relationship among them instead of having parent child relationship.
  • 14. Graph (cont.) 1. Undirected Graph (a) An undirected graph G having five vertices and seven edges. (b) An adjacency-list representation of G. (c) The adjacency-matrix representationof G. 2. Directed Graph (a) A directed graph G having six vertices and eight edges. (b) An adjacency-list representation of G. (c) The adjacency-matrix representation of G.
  • 15. Graph (cont.) Depth First Search (DFS) Breadth First Search (BFS) Graph Traversal