SlideShare a Scribd company logo
Introduction to Data Structures By: Abdul Ghaffar
Contents Introduction Queues Stacks  Linked lists Trees
Basic Terminology Data Raw facts and figures are called data. Information Data with given attributes, or meaningful or processed data is called  information Group & Elementary data items If a data item can be divided into sub items then it is called group item else it is called elementary item. Entity An entity is something that has certain attributes or properties which may be assigned values.
Basic Terminology Entity Set Entities with similar attributes form an entity set . Hierarchy of data organization Field A field is a single elementary unit of information representing an attribute of an entity. Record A record is collection of field  values of a given entity. File A file is a collection of records of the entities in a given entity set
Basic Terminology Primary Key If the value in certain field may uniquely identity the record in the file then such a field is called primary key
Basic Terminology Data Structures The logical and mathematical model of a particular organization of data is called Data structure Essential to implement most algorithms Data Structures + Algorithms = Programs Computer languages support their creation Defined using “primitive types” and language constructs Steps the in study of Data Structures Logical or mathematical description of the structure Implementation of the structure on a computer Quantitative analysis of the structure (time & Space)
Data Structures Arrays A list of finite number n of similar data elements referenced respectively by a set of n consecutive numbers One-Dimensional Two-Dimensional Three-Dimensional
Data Structures Linked List A linked list is a linear collection of data elements, called nodes, where linear order is given by means of pointers. 7 next head 11 next 14 next 18 next NULL
Data Structures Trees The data structure which reflects hierarchical relationship between various elements is called a rooted tree or simply Tree. 17 15 14 9 6 5 8
Data Structures Stack A stack is a linear list in which insertion and deletion can take place only at one end (LIFO) 9 1 2 3 4 5 6 7 8 9 11 7 18 14 S top
Data Structures Queue A queue is a linear list in which deletion & insertion can not take place at the same end (FIFO) 1 2 3 4 5 6 7 8 9 11 7 18 14 Q head tail
Data Structures Graph  The data structure which reflects relationship between pairs of elements is called a graph.
Data Structures Data Structure Operations Traversing Searching Inserting Deletion Sorting Merging MINIMUM(S) MAXIMUM(S) IsEMPTY(S) PRINT(S) COUNT(S)
Algorithm Algorithm An algorithm is a finite step by step list of well defined instructions for solving a particular problem.
Algorithm Example
Algorithm Control Structures Sequence logic Selection logic Single  alternative If condition, then [Module A] [End of if structure]
Algorithm Double Alternative If condition, then [Module A] Else [Module B] [End of If structure]
Algorithm Multiple Alternatives If condition, then [Module A] Else if  condition2,  then [Module B] Else if  condition3, then [Module C] Else if  condition4, then [Module D] Else  [Module E] [End of if structure]
Algorithm Example
Algorithm Control Structures Iteration logic Repeat for K=R to S by T [Module] [End of loop] Repeat while condition [Module] [End of loop]
Algorithm Example
Algorithm Complexity of Algorithm The complexity of an algorithm f(n) is the function which gives the ruining time or space in term of the input size. Time-Space trade-off The Time-Space trade-off refers to a choice between algorithmic solution of a data processing problem that allows one to decrease the running time of an algorithmic solution by increasing the space to store the data and vice versa. Linear Search C(n) = (n+1)/2 Binary Search C(n) = log 2  n
Algorithm Binary Search

More Related Content

PPTX
Trees data structure
PPTX
Introduction to data structure
PPT
Basics of data structure
PPTX
Data Structures - Lecture 8 [Sorting Algorithms]
PPTX
Sorting Algorithm
PDF
Introduction to Data Flow Diagram (DFD)
PPT
Abstract data types (adt) intro to data structure part 2
PDF
Introduction to data structure
Trees data structure
Introduction to data structure
Basics of data structure
Data Structures - Lecture 8 [Sorting Algorithms]
Sorting Algorithm
Introduction to Data Flow Diagram (DFD)
Abstract data types (adt) intro to data structure part 2
Introduction to data structure

What's hot (20)

PPT
Data structure
PPT
pipeline and vector processing
PPT
11. transaction sql
PPTX
Stacks and Queue - Data Structures
PPTX
trigger dbms
PPTX
Different types of Shoring Algorithms with Animation
PPT
Unit 4 data storage and querying
PPT
DATA REPRESENTATION
PPTX
Regular expressions
PPTX
What is sparse matrix
PDF
3b. LMD & RMD.pdf
PPT
Data Mining: Concepts and Techniques — Chapter 2 —
PPT
data structure
PPTX
Register transfer language
PPTX
Stack of Data structure
PPTX
TYPES DATA STRUCTURES( LINEAR AND NON LINEAR)....
PDF
DBMS Unit - 6 - Transaction Management
PPTX
Data structure - Graph
PPTX
Predictive parser
PPTX
set operators.pptx
Data structure
pipeline and vector processing
11. transaction sql
Stacks and Queue - Data Structures
trigger dbms
Different types of Shoring Algorithms with Animation
Unit 4 data storage and querying
DATA REPRESENTATION
Regular expressions
What is sparse matrix
3b. LMD & RMD.pdf
Data Mining: Concepts and Techniques — Chapter 2 —
data structure
Register transfer language
Stack of Data structure
TYPES DATA STRUCTURES( LINEAR AND NON LINEAR)....
DBMS Unit - 6 - Transaction Management
Data structure - Graph
Predictive parser
set operators.pptx
Ad

Viewers also liked (20)

PPT
List Data Structure
PPTX
Data Structure -List Stack Queue
PPTX
Linked list
PPTX
Fraud Analytics
PPTX
Analysis of-credit-card-fault-detection
PPT
Complexity of Algorithm
PPT
Decimal to binary number
PPTX
Data structure and its types
PDF
K to 12 PC Hardware Servicing Learning Module
PPT
THE INTERNET OF THINGS
PPT
Stack Operation In Data Structure
PPT
Ch 8 introduction to data structures
PPTX
Linked List data structure
PDF
Cash flow direct method outline
PPT
01.Number Systems
PPTX
L 2 basic computer organization
PDF
Reciprocal Allocation Method
PPTX
Cash flow direct method
PDF
Chapter02 basic computer organization
PPTX
Binary Codes and Number System
List Data Structure
Data Structure -List Stack Queue
Linked list
Fraud Analytics
Analysis of-credit-card-fault-detection
Complexity of Algorithm
Decimal to binary number
Data structure and its types
K to 12 PC Hardware Servicing Learning Module
THE INTERNET OF THINGS
Stack Operation In Data Structure
Ch 8 introduction to data structures
Linked List data structure
Cash flow direct method outline
01.Number Systems
L 2 basic computer organization
Reciprocal Allocation Method
Cash flow direct method
Chapter02 basic computer organization
Binary Codes and Number System
Ad

Similar to Introductiont To Aray,Tree,Stack, Queue (20)

PPT
DATA STRUCTURE AND ALGORITJM POWERPOINT.ppt
PPT
1597380885789.ppt
PPT
data structure details of types and .ppt
PPTX
Data_structures_and_algorithm_Lec_1.pptx
PPTX
Data_structures_and_algorithm_Lec_1.pptx
PPTX
DS_PPT.pptx
PPT
PPT
Introduction of data structure in short.ppt
PPT
PMDATA STRUICVIUDGHfjufguigfuigkguidfui.ppt
PPT
Data structure study material introduction
PPTX
Data structures - Introduction
PPT
DATA STRUCTURES A BRIEF OVERVIEW OF DATA
PPTX
Array Data StructureData StructureData Structure.pptx
PPT
PM.ppt DATA STRUCTURE USING C WITH EXAMPLE PROGRAMES
PPT
DS_INTROduction dhjm,asjkfnsflkwefskdmcsdmckds
PPT
DSA theory all topics (summary) presentation
PPT
Basic Data Structure and its concepts details
PPT
DATA STRUCTURES IN INFORMATION TECHNOLOGY
PPT
Data Structures and Algorithm for Engineers.ppt
DATA STRUCTURE AND ALGORITJM POWERPOINT.ppt
1597380885789.ppt
data structure details of types and .ppt
Data_structures_and_algorithm_Lec_1.pptx
Data_structures_and_algorithm_Lec_1.pptx
DS_PPT.pptx
Introduction of data structure in short.ppt
PMDATA STRUICVIUDGHfjufguigfuigkguidfui.ppt
Data structure study material introduction
Data structures - Introduction
DATA STRUCTURES A BRIEF OVERVIEW OF DATA
Array Data StructureData StructureData Structure.pptx
PM.ppt DATA STRUCTURE USING C WITH EXAMPLE PROGRAMES
DS_INTROduction dhjm,asjkfnsflkwefskdmcsdmckds
DSA theory all topics (summary) presentation
Basic Data Structure and its concepts details
DATA STRUCTURES IN INFORMATION TECHNOLOGY
Data Structures and Algorithm for Engineers.ppt

More from Ghaffar Khan (20)

PPT
World is beautiful ... ...
PPTX
My Presentation On Ajax
PPT
Sorting
PPT
How A Computer Works
PPT
For Loop
PPT
Exponential and Logarthmic funtions
PPT
Exponential and Logarthmic funtions (1)
PPT
Functions
PPT
Quadratic And Polinomial Function
PPT
Quadratic And Polinomial Function
PPT
Exponentioal And Logarthmic Functions
PPT
Internet Protocol
PPT
Introduction to Computer Networks
PPT
Network Layer
PPT
Control Structures
PPT
Input And Output
PPT
Surfaces
PPT
Vector Tools
PPT
Drawing Tools
PPT
Drawing Figures
World is beautiful ... ...
My Presentation On Ajax
Sorting
How A Computer Works
For Loop
Exponential and Logarthmic funtions
Exponential and Logarthmic funtions (1)
Functions
Quadratic And Polinomial Function
Quadratic And Polinomial Function
Exponentioal And Logarthmic Functions
Internet Protocol
Introduction to Computer Networks
Network Layer
Control Structures
Input And Output
Surfaces
Vector Tools
Drawing Tools
Drawing Figures

Recently uploaded (20)

PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Empathic Computing: Creating Shared Understanding
PDF
Approach and Philosophy of On baking technology
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Unlocking AI with Model Context Protocol (MCP)
PPT
Teaching material agriculture food technology
PPTX
Tartificialntelligence_presentation.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Getting Started with Data Integration: FME Form 101
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
Assigned Numbers - 2025 - Bluetooth® Document
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
Empathic Computing: Creating Shared Understanding
Approach and Philosophy of On baking technology
“AI and Expert System Decision Support & Business Intelligence Systems”
Dropbox Q2 2025 Financial Results & Investor Presentation
Advanced methodologies resolving dimensionality complications for autism neur...
MIND Revenue Release Quarter 2 2025 Press Release
NewMind AI Weekly Chronicles - August'25-Week II
Programs and apps: productivity, graphics, security and other tools
Network Security Unit 5.pdf for BCA BBA.
Unlocking AI with Model Context Protocol (MCP)
Teaching material agriculture food technology
Tartificialntelligence_presentation.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Getting Started with Data Integration: FME Form 101
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
20250228 LYD VKU AI Blended-Learning.pptx

Introductiont To Aray,Tree,Stack, Queue

  • 1. Introduction to Data Structures By: Abdul Ghaffar
  • 2. Contents Introduction Queues Stacks Linked lists Trees
  • 3. Basic Terminology Data Raw facts and figures are called data. Information Data with given attributes, or meaningful or processed data is called information Group & Elementary data items If a data item can be divided into sub items then it is called group item else it is called elementary item. Entity An entity is something that has certain attributes or properties which may be assigned values.
  • 4. Basic Terminology Entity Set Entities with similar attributes form an entity set . Hierarchy of data organization Field A field is a single elementary unit of information representing an attribute of an entity. Record A record is collection of field values of a given entity. File A file is a collection of records of the entities in a given entity set
  • 5. Basic Terminology Primary Key If the value in certain field may uniquely identity the record in the file then such a field is called primary key
  • 6. Basic Terminology Data Structures The logical and mathematical model of a particular organization of data is called Data structure Essential to implement most algorithms Data Structures + Algorithms = Programs Computer languages support their creation Defined using “primitive types” and language constructs Steps the in study of Data Structures Logical or mathematical description of the structure Implementation of the structure on a computer Quantitative analysis of the structure (time & Space)
  • 7. Data Structures Arrays A list of finite number n of similar data elements referenced respectively by a set of n consecutive numbers One-Dimensional Two-Dimensional Three-Dimensional
  • 8. Data Structures Linked List A linked list is a linear collection of data elements, called nodes, where linear order is given by means of pointers. 7 next head 11 next 14 next 18 next NULL
  • 9. Data Structures Trees The data structure which reflects hierarchical relationship between various elements is called a rooted tree or simply Tree. 17 15 14 9 6 5 8
  • 10. Data Structures Stack A stack is a linear list in which insertion and deletion can take place only at one end (LIFO) 9 1 2 3 4 5 6 7 8 9 11 7 18 14 S top
  • 11. Data Structures Queue A queue is a linear list in which deletion & insertion can not take place at the same end (FIFO) 1 2 3 4 5 6 7 8 9 11 7 18 14 Q head tail
  • 12. Data Structures Graph The data structure which reflects relationship between pairs of elements is called a graph.
  • 13. Data Structures Data Structure Operations Traversing Searching Inserting Deletion Sorting Merging MINIMUM(S) MAXIMUM(S) IsEMPTY(S) PRINT(S) COUNT(S)
  • 14. Algorithm Algorithm An algorithm is a finite step by step list of well defined instructions for solving a particular problem.
  • 16. Algorithm Control Structures Sequence logic Selection logic Single alternative If condition, then [Module A] [End of if structure]
  • 17. Algorithm Double Alternative If condition, then [Module A] Else [Module B] [End of If structure]
  • 18. Algorithm Multiple Alternatives If condition, then [Module A] Else if condition2, then [Module B] Else if condition3, then [Module C] Else if condition4, then [Module D] Else [Module E] [End of if structure]
  • 20. Algorithm Control Structures Iteration logic Repeat for K=R to S by T [Module] [End of loop] Repeat while condition [Module] [End of loop]
  • 22. Algorithm Complexity of Algorithm The complexity of an algorithm f(n) is the function which gives the ruining time or space in term of the input size. Time-Space trade-off The Time-Space trade-off refers to a choice between algorithmic solution of a data processing problem that allows one to decrease the running time of an algorithmic solution by increasing the space to store the data and vice versa. Linear Search C(n) = (n+1)/2 Binary Search C(n) = log 2 n