SlideShare une entreprise Scribd logo
1  sur  16
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?

Contenu connexe

Tendances

Introduction to data structure ppt
Introduction to data structure pptIntroduction to data structure ppt
Introduction to data structure pptNalinNishant3
 
Data Structures Notes 2021
Data Structures Notes 2021Data Structures Notes 2021
Data Structures Notes 2021Sreedhar Chowdam
 
1.1 binary tree
1.1 binary tree1.1 binary tree
1.1 binary treeKrish_ver2
 
Data structure & its types
Data structure & its typesData structure & its types
Data structure & its typesRameesha Sadaqat
 
Data structures (introduction)
 Data structures (introduction) Data structures (introduction)
Data structures (introduction)Arvind Devaraj
 
Introductiont To Aray,Tree,Stack, Queue
Introductiont To Aray,Tree,Stack, QueueIntroductiont To Aray,Tree,Stack, Queue
Introductiont To Aray,Tree,Stack, QueueGhaffar Khan
 
Data structure & algorithms introduction
Data structure & algorithms introductionData structure & algorithms introduction
Data structure & algorithms introductionSugandh Wafai
 
Introduction to data structure
Introduction to data structureIntroduction to data structure
Introduction to data structureVivek Kumar Sinha
 
Ii pu cs practical viva voce questions
Ii pu cs  practical viva voce questionsIi pu cs  practical viva voce questions
Ii pu cs practical viva voce questionsProf. Dr. K. Adisesha
 
Introduction to data structure
Introduction to data structureIntroduction to data structure
Introduction to data structureadeel hamid
 
Introduction To Data Structures.
Introduction To Data Structures.Introduction To Data Structures.
Introduction To Data Structures.Education Front
 
Presentation on Data Structure
Presentation on Data StructurePresentation on Data Structure
Presentation on Data StructureA. N. M. Jubaer
 
Trees - Data structures in C/Java
Trees - Data structures in C/JavaTrees - Data structures in C/Java
Trees - Data structures in C/Javageeksrik
 
Data structure and its types
Data structure and its typesData structure and its types
Data structure and its typesNavtar Sidhu Brar
 
Introduction to data structure
Introduction to data structure Introduction to data structure
Introduction to data structure NUPOORAWSARMOL
 

Tendances (20)

Introduction to data structure ppt
Introduction to data structure pptIntroduction to data structure ppt
Introduction to data structure ppt
 
Data Structures Notes 2021
Data Structures Notes 2021Data Structures Notes 2021
Data Structures Notes 2021
 
Data Structures
Data StructuresData Structures
Data Structures
 
1.1 binary tree
1.1 binary tree1.1 binary tree
1.1 binary tree
 
Data structure & its types
Data structure & its typesData structure & its types
Data structure & its types
 
Data structures (introduction)
 Data structures (introduction) Data structures (introduction)
Data structures (introduction)
 
Introductiont To Aray,Tree,Stack, Queue
Introductiont To Aray,Tree,Stack, QueueIntroductiont To Aray,Tree,Stack, Queue
Introductiont To Aray,Tree,Stack, Queue
 
Data Structure Basics
Data Structure BasicsData Structure Basics
Data Structure Basics
 
Data structure using c++
Data structure using c++Data structure using c++
Data structure using c++
 
Data structure & algorithms introduction
Data structure & algorithms introductionData structure & algorithms introduction
Data structure & algorithms introduction
 
Introduction to data structure
Introduction to data structureIntroduction to data structure
Introduction to data structure
 
Ii pu cs practical viva voce questions
Ii pu cs  practical viva voce questionsIi pu cs  practical viva voce questions
Ii pu cs practical viva voce questions
 
Introduction to data structure
Introduction to data structureIntroduction to data structure
Introduction to data structure
 
Introduction To Data Structures.
Introduction To Data Structures.Introduction To Data Structures.
Introduction To Data Structures.
 
Presentation on Data Structure
Presentation on Data StructurePresentation on Data Structure
Presentation on Data Structure
 
Trees - Data structures in C/Java
Trees - Data structures in C/JavaTrees - Data structures in C/Java
Trees - Data structures in C/Java
 
Data structures
Data structuresData structures
Data structures
 
Data structure and its types
Data structure and its typesData structure and its types
Data structure and its types
 
Introduction to data structure
Introduction to data structure Introduction to data structure
Introduction to data structure
 
Tree - Data Structure
Tree - Data StructureTree - Data Structure
Tree - Data Structure
 

Similaire à Data Structures

Introduction to Data Structure
Introduction to Data StructureIntroduction to Data Structure
Introduction to Data StructureJazz Jinia Bhowmik
 
data structures and algorithms Unit 1
data structures and algorithms Unit 1data structures and algorithms Unit 1
data structures and algorithms Unit 1infanciaj
 
Data Structures & Algorithms Unit 1.pptx
Data Structures & Algorithms Unit 1.pptxData Structures & Algorithms Unit 1.pptx
Data Structures & Algorithms Unit 1.pptxUsriDevi1
 
Fundamentals of data structures
Fundamentals of data structuresFundamentals of data structures
Fundamentals of data structuresNiraj Agarwal
 
Operations on linked list
Operations on linked listOperations on linked list
Operations on linked listSumathi Kv
 
1.3 Linked List.pptx
1.3 Linked List.pptx1.3 Linked List.pptx
1.3 Linked List.pptxssuserd2f031
 
Linked list (introduction) 1
Linked list (introduction) 1Linked list (introduction) 1
Linked list (introduction) 1DrSudeshna
 
02 linked list_20160217_jintaekseo
02 linked list_20160217_jintaekseo02 linked list_20160217_jintaekseo
02 linked list_20160217_jintaekseoJinTaek Seo
 
DATA STRUCTURE AND ALGORITJM POWERPOINT.ppt
DATA STRUCTURE AND ALGORITJM POWERPOINT.pptDATA STRUCTURE AND ALGORITJM POWERPOINT.ppt
DATA STRUCTURE AND ALGORITJM POWERPOINT.pptyarotos643
 
Datastructures and algorithms prepared by M.V.Brehmanada Reddy
Datastructures and algorithms prepared by M.V.Brehmanada ReddyDatastructures and algorithms prepared by M.V.Brehmanada Reddy
Datastructures and algorithms prepared by M.V.Brehmanada ReddyMalikireddy Bramhananda Reddy
 
[Queue , linked list , tree]
[Queue , linked list , tree][Queue , linked list , tree]
[Queue , linked list , tree]Nowrin Nishat
 
1 list datastructures
1 list datastructures1 list datastructures
1 list datastructuresNguync91368
 
C++ Data Structure PPT.pptx
C++ Data Structure PPT.pptxC++ Data Structure PPT.pptx
C++ Data Structure PPT.pptxMukesh Thakur
 
Ch 1 intriductions
Ch 1 intriductionsCh 1 intriductions
Ch 1 intriductionsirshad17
 
Application of Data structure
Application of Data structureApplication of Data structure
Application of Data structureDeepika051991
 

Similaire à Data Structures (20)

Introduction to Data Structure
Introduction to Data StructureIntroduction to Data Structure
Introduction to Data Structure
 
data structures and algorithms Unit 1
data structures and algorithms Unit 1data structures and algorithms Unit 1
data structures and algorithms Unit 1
 
General Data structures
General Data structuresGeneral Data structures
General Data structures
 
Data Structures & Algorithms Unit 1.pptx
Data Structures & Algorithms Unit 1.pptxData Structures & Algorithms Unit 1.pptx
Data Structures & Algorithms Unit 1.pptx
 
Fundamentals of data structures
Fundamentals of data structuresFundamentals of data structures
Fundamentals of data structures
 
Operations on linked list
Operations on linked listOperations on linked list
Operations on linked list
 
Data structures notes
Data structures notesData structures notes
Data structures notes
 
1.3 Linked List.pptx
1.3 Linked List.pptx1.3 Linked List.pptx
1.3 Linked List.pptx
 
Data Structure
Data StructureData Structure
Data Structure
 
Linked list (introduction) 1
Linked list (introduction) 1Linked list (introduction) 1
Linked list (introduction) 1
 
02 linked list_20160217_jintaekseo
02 linked list_20160217_jintaekseo02 linked list_20160217_jintaekseo
02 linked list_20160217_jintaekseo
 
DATA STRUCTURE AND ALGORITJM POWERPOINT.ppt
DATA STRUCTURE AND ALGORITJM POWERPOINT.pptDATA STRUCTURE AND ALGORITJM POWERPOINT.ppt
DATA STRUCTURE AND ALGORITJM POWERPOINT.ppt
 
1597380885789.ppt
1597380885789.ppt1597380885789.ppt
1597380885789.ppt
 
UNITIII LDS.pdf
UNITIII LDS.pdfUNITIII LDS.pdf
UNITIII LDS.pdf
 
Datastructures and algorithms prepared by M.V.Brehmanada Reddy
Datastructures and algorithms prepared by M.V.Brehmanada ReddyDatastructures and algorithms prepared by M.V.Brehmanada Reddy
Datastructures and algorithms prepared by M.V.Brehmanada Reddy
 
[Queue , linked list , tree]
[Queue , linked list , tree][Queue , linked list , tree]
[Queue , linked list , tree]
 
1 list datastructures
1 list datastructures1 list datastructures
1 list datastructures
 
C++ Data Structure PPT.pptx
C++ Data Structure PPT.pptxC++ Data Structure PPT.pptx
C++ Data Structure PPT.pptx
 
Ch 1 intriductions
Ch 1 intriductionsCh 1 intriductions
Ch 1 intriductions
 
Application of Data structure
Application of Data structureApplication of Data structure
Application of Data structure
 

Plus de Rahul Jamwal

Process & Mutlithreading
Process & MutlithreadingProcess & Mutlithreading
Process & MutlithreadingRahul Jamwal
 
Searching & Sorting Algorithms
Searching & Sorting AlgorithmsSearching & Sorting Algorithms
Searching & Sorting AlgorithmsRahul Jamwal
 
C++ Memory Management
C++ Memory ManagementC++ Memory Management
C++ Memory ManagementRahul Jamwal
 
Virtual Memory Management
Virtual Memory ManagementVirtual Memory Management
Virtual Memory ManagementRahul Jamwal
 
C++ shared libraries and loading
C++ shared libraries and loadingC++ shared libraries and loading
C++ shared libraries and loadingRahul Jamwal
 
C++ compilation process
C++ compilation processC++ compilation process
C++ compilation processRahul Jamwal
 

Plus de Rahul Jamwal (6)

Process & Mutlithreading
Process & MutlithreadingProcess & Mutlithreading
Process & Mutlithreading
 
Searching & Sorting Algorithms
Searching & Sorting AlgorithmsSearching & Sorting Algorithms
Searching & Sorting Algorithms
 
C++ Memory Management
C++ Memory ManagementC++ Memory Management
C++ Memory Management
 
Virtual Memory Management
Virtual Memory ManagementVirtual Memory Management
Virtual Memory Management
 
C++ shared libraries and loading
C++ shared libraries and loadingC++ shared libraries and loading
C++ shared libraries and loading
 
C++ compilation process
C++ compilation processC++ compilation process
C++ compilation process
 

Dernier

Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 

Dernier (20)

Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 

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