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

PPT
Abstract data types (adt) intro to data structure part 2
PDF
UNIT I LINEAR DATA STRUCTURES – LIST
PDF
Chapter 1 Introduction to Data Structures and Algorithms.pdf
PDF
Data Structures (BE)
PPT
Data Structure and Algorithms Linked List
PDF
Singly linked list
PPT
Chapter 1( intro & overview)
PPT
Data structures & algorithms lecture 3
Abstract data types (adt) intro to data structure part 2
UNIT I LINEAR DATA STRUCTURES – LIST
Chapter 1 Introduction to Data Structures and Algorithms.pdf
Data Structures (BE)
Data Structure and Algorithms Linked List
Singly linked list
Chapter 1( intro & overview)
Data structures & algorithms lecture 3

What's hot (20)

PPT
Binary tree
PPTX
Data warehousing.pptx
PPT
Data structure lecture 1
PPTX
Computer Science-Data Structures :Abstract DataType (ADT)
PPTX
PDF
BCA DATA STRUCTURES LINEAR ARRAYS MRS.SOWMYA JYOTHI
PPT
Basics of data structure
PPTX
single linked list
PPT
Queue Data Structure
PPTX
Lecture 2 data structures and algorithms
PPT
Doubly linked list
PPT
Skip list vinay khimsuriya_200430723005
PPT
Queue AS an ADT (Abstract Data Type)
PPTX
3 tier data warehouse
 
PPT
Data structure
PPTX
Data Definition and Data Manipulation Language-DDL & DML
PPTX
Data Preprocessing || Data Mining
PPT
Elementary data organisation
PPTX
Arrays in Data Structure and Algorithm
PPTX
Data reduction
Binary tree
Data warehousing.pptx
Data structure lecture 1
Computer Science-Data Structures :Abstract DataType (ADT)
BCA DATA STRUCTURES LINEAR ARRAYS MRS.SOWMYA JYOTHI
Basics of data structure
single linked list
Queue Data Structure
Lecture 2 data structures and algorithms
Doubly linked list
Skip list vinay khimsuriya_200430723005
Queue AS an ADT (Abstract Data Type)
3 tier data warehouse
 
Data structure
Data Definition and Data Manipulation Language-DDL & DML
Data Preprocessing || Data Mining
Elementary data organisation
Arrays in Data Structure and Algorithm
Data reduction
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
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
cuic standard and advanced reporting.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Approach and Philosophy of On baking technology
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Electronic commerce courselecture one. Pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
NewMind AI Weekly Chronicles - August'25 Week I
Advanced methodologies resolving dimensionality complications for autism neur...
20250228 LYD VKU AI Blended-Learning.pptx
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Mobile App Security Testing_ A Comprehensive Guide.pdf
cuic standard and advanced reporting.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Approach and Philosophy of On baking technology
Building Integrated photovoltaic BIPV_UPV.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Electronic commerce courselecture one. Pdf
Network Security Unit 5.pdf for BCA BBA.
Per capita expenditure prediction using model stacking based on satellite ima...
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Programs and apps: productivity, graphics, security and other tools
Unlocking AI with Model Context Protocol (MCP)
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
NewMind AI Weekly Chronicles - August'25 Week I

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