SlideShare uma empresa Scribd logo
1 de 21
Prepared by
P.Prathibha
Topics
Definitions
Introduction to Data structures
Classification of Data structures
Data:
• Collection of raw facts.
• Data are simply a value are set of values of different type which is called data types like
string, integer, char etc.
Structure: Way of organizing information, so that it is easier to use.
Data structure is
• representation of the logical relationship existing between individual elements of data.
• a specialized format for organizing and storing data in memory that considers not only
the elements stored but also their relationship to each other.
• about structuring or arranging and storing of data in such a way so that it can be accessed
and used efficiently.
Definition
 Data structure affects the design of both structural & functional aspects o
f a program.
Program = algorithm + Data Structure
 We know that a algorithm is a step by step procedure to solve a particula
r function.
 That means, algorithm is a set of instruction written to carry out certain
tasks & the data structure is the way of organizing the data with their
logical relationship retained.
 To develop a program of an algorithm, we should select an appropriate
data structure for that algorithm.
Therefore algorithm and its associated data structures form a program.
INTRODUCTION
Why Data Structure
 Human requirement with computer are going to
complex day by day.
 To solve the complex requirements in efficient way we n
eed this
 Provide fastest solution of human requirements.
 Provide efficient solution of complex problem.
– Space
– Time
 Data structures are the ways of organizing and storing d
ata in a computer so that we can perform several o
perations efficiently on it.
 It is widely used in every aspect of computer science.
The main idea behind Data structure is to
 reduces the memory usage of a Data Structure operation i.e., space complexity
 reduces the execution time of operations on Data Structure i.e., the time
complexity
Data Structures Study Covers:
 Amount of memory require to store
 Amount of time require to process
 Representation of data in memory
 Operatins performed on that data
As applications are getting complexed and amount of data is increasing day by day,
there may arrise the following problems:
Processor speed: To handle very large amout of data, high speed processing is
required, but as the data is growing day by day to the billions of files per entity,
processor may fail to deal with that much amount of data.
Data Search: Consider an inventory size of 120 items in a store, If our application
needs to search for a particular item, it needs to traverse 120 items every time,
results 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 chances that a very large server can be failed
during that process
In order to solve the above problems, data structures are used.
Need of Data Structures
Efficiency: Efficiency of a program depends upon the choice of data st
ructures.
For example: suppose, we have some data and we need to
perform the search for a perticular record. In that case, if we organize our
data in an array, we will have to search sequentially element by element.
hence, using array may not be very efficient here. There are better data
structures which can make the search process efficient like ordered array,
binary search tree or hash tables.
Reusability: Data structures are reusable, i.e. once we have implemented a p
articular data structure, we can use it at any other place.
Abstraction: Data structure is specified by the ADT which provides a level of
abstraction. The client program uses the data structure through interface on
ly, without getting into the implementation details.
Advantages of Data Structures
Primitive Data Structure
 These are basic structures and directly operated upon
by the machine instructions.
 Data structures that are directly operated upon the
machine-level instructions are known as primitive
data structures.
 Primitive data structures have different representation
s on different computers.
 Integer, Floating-point number, Character constants,
string constants, pointers etc, fall in this category.
 The most commonly used operation on data structure
are broadly categorized into :
◦ Create
◦ Selection
◦ Updating
◦ Destroy or Delete
 These are more sophisticated data structures.
 These are derived from primitive data structures.
 The non-primitive data structures emphasize on structuring of a group of
homogeneous (same type) or heterogeneous (different type) data items.
 Lists, Stack, Queue, Tree, Graph are example of non-primitive data structures.
 The most commonly used operation on data structure are broadly
categorized into following types:
• Create
• Selection
• Updating
• Searching
• Sorting
• Merging
• Destroy or Delete
Linear Data structures:
 Linear Data structures are kind of data structure that has homogeneous
elements.
 A data structure is called linear if all of its elements are arranged in the linear o
rder.
 In linear data structures, the elements are stored in non-hierarchical way wher
e each element has the successors and predecessors except the first and last
element.
 The data structure in which elements are in a sequence and form a liner series.
 Linear data structures are very easy to implement, since the memory of the
computer is also organized in a linear fashion.
 Some commonly used linear data structures are Stack, Queue and Linked Lists
 There are two ways to represent a linear data structure in memory.
 Static memory allocation
 Dynamic memory allocation
Arrays: An array is a collection of similar type of data items and each data item is
called an element of the array.
• The data type of the element may be any valid data type 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, two dimensional or multidimensional.
• The individual elements of the array age are:
age[0], age[1], age[2], age[3],......... age[98], age[99].
Types of Linear Data Structures
Linked List: Linked list is a linear data structure 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.
• In simple words, a linked list consists of nodes where each node contains a
data field and a reference(link) to the next node in the list.
Stack: Stack is a linear list in which insertion and deletions are allowed only at one end, called
top.
• A stack is an abstract data type (ADT), 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.
• Stack is a linear data structure which follows a particular order in which the operations are
performed.
• The order may be LIFO(Last In First Out) or FILO(First In Last Out).
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 it
ems.
◦ A Non-Linear Data structures is a data structure in w
hich data item is connected to several other data i
tems.
◦ Non-Linear data structure may exhibit either a hi
erarchical relationship or parent child re
lationship.
◦ The data elements are not arranged in a sequential st
ructure.
◦ The different non-linear data structures are trees a
nd graphs
Non-Linear Data structures:
Trees: Trees are multilevel data structures with a hierarchical relationship among its elements
known as nodes.
• The bottommost nodes in the herierchy are called leaf node
• while the topmost node is called root node.
• Each node contains pointers to point adjacent nodes.
• Tree data structure is 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 atmost one parent except the root node.
• Trees can be classfied into many categories
Types of Non Linear Data Structures
Graphs: Graphs can be defined as the pictorial representation of the set of elements
(represented by vertices) connected by the links known as edges.
• A Graph is a non-linear data structure consisting of nodes and edges.
• The nodes are sometimes also referred to as vertices and the edges are lines or arcs
that connect any two nodes in the graph.
• More formally a Graph can be defined as,
A Graph consists of a finite set of vertices(or nodes) and set of Edges which c
onnect a pair of nodes.
• A graph is different from tree in the sense that a graph can have cycle while the
tree can not have the one.
 Introduction to Data structures
 Classification of Data structures
Summary
Introduction to data structures (ss)

Mais conteúdo relacionado

Mais procurados

All data models in dbms
All data models in dbmsAll data models in dbms
All data models in dbms
Naresh Kumar
 
12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMS12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMS
koolkampus
 

Mais procurados (20)

Introduction to data structure
Introduction to data structureIntroduction to data structure
Introduction to data structure
 
Dbms architecture
Dbms architectureDbms architecture
Dbms architecture
 
Hashing
HashingHashing
Hashing
 
PPT On Sorting And Searching Concepts In Data Structure | In Programming Lang...
PPT On Sorting And Searching Concepts In Data Structure | In Programming Lang...PPT On Sorting And Searching Concepts In Data Structure | In Programming Lang...
PPT On Sorting And Searching Concepts In Data Structure | In Programming Lang...
 
Data Structures (CS8391)
Data Structures (CS8391)Data Structures (CS8391)
Data Structures (CS8391)
 
UNIT I LINEAR DATA STRUCTURES – LIST
UNIT I 	LINEAR DATA STRUCTURES – LIST 	UNIT I 	LINEAR DATA STRUCTURES – LIST
UNIT I LINEAR DATA STRUCTURES – LIST
 
Tree and graph
Tree and graphTree and graph
Tree and graph
 
Data structure power point presentation
Data structure power point presentation Data structure power point presentation
Data structure power point presentation
 
Data Structures & Recursion-Introduction.pdf
Data Structures & Recursion-Introduction.pdfData Structures & Recursion-Introduction.pdf
Data Structures & Recursion-Introduction.pdf
 
Introduction to data structure ppt
Introduction to data structure pptIntroduction to data structure ppt
Introduction to data structure ppt
 
All data models in dbms
All data models in dbmsAll data models in dbms
All data models in dbms
 
Sparse matrix
Sparse matrixSparse matrix
Sparse matrix
 
BCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHI
BCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHIBCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHI
BCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHI
 
DATA STRUCTURES
DATA STRUCTURESDATA STRUCTURES
DATA STRUCTURES
 
Data structures and algorithms short note (version 14).pd
Data structures and algorithms short note (version 14).pdData structures and algorithms short note (version 14).pd
Data structures and algorithms short note (version 14).pd
 
linked list in data structure
linked list in data structure linked list in data structure
linked list in data structure
 
Searching and Sorting Techniques in Data Structure
Searching and Sorting Techniques in Data StructureSearching and Sorting Techniques in Data Structure
Searching and Sorting Techniques in Data Structure
 
1.1 binary tree
1.1 binary tree1.1 binary tree
1.1 binary tree
 
B trees dbms
B trees dbmsB trees dbms
B trees dbms
 
12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMS12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMS
 

Semelhante a Introduction to data structures (ss)

Data structure chapter 1.pptx
Data structure chapter 1.pptxData structure chapter 1.pptx
Data structure chapter 1.pptx
Kami503928
 
09c-DataStructuresListsArrays.ppt
09c-DataStructuresListsArrays.ppt09c-DataStructuresListsArrays.ppt
09c-DataStructuresListsArrays.ppt
NagarajuNaveena1
 

Semelhante a Introduction to data structures (ss) (20)

Unit-1 DataStructure Intro.pptx
Unit-1 DataStructure Intro.pptxUnit-1 DataStructure Intro.pptx
Unit-1 DataStructure Intro.pptx
 
Lecture 2 Data Structure Introduction
Lecture 2 Data Structure IntroductionLecture 2 Data Structure Introduction
Lecture 2 Data Structure Introduction
 
DataStructurePpt.pptx
DataStructurePpt.pptxDataStructurePpt.pptx
DataStructurePpt.pptx
 
DataStructurePpt.pptx
DataStructurePpt.pptxDataStructurePpt.pptx
DataStructurePpt.pptx
 
Unit.1 Introduction to Data Structuresres
Unit.1 Introduction to Data StructuresresUnit.1 Introduction to Data Structuresres
Unit.1 Introduction to Data Structuresres
 
Data structure (basics)
Data structure (basics)Data structure (basics)
Data structure (basics)
 
Ch1
Ch1Ch1
Ch1
 
PPT Format prashant .pptx
PPT Format prashant .pptxPPT Format prashant .pptx
PPT Format prashant .pptx
 
Introduction to Data Structures
Introduction to Data StructuresIntroduction to Data Structures
Introduction to Data Structures
 
Data structure chapter 1.pptx
Data structure chapter 1.pptxData structure chapter 1.pptx
Data structure chapter 1.pptx
 
Dsa unit 1
Dsa unit 1Dsa unit 1
Dsa unit 1
 
DSA - Copy.pptx
DSA - Copy.pptxDSA - Copy.pptx
DSA - Copy.pptx
 
09c-DataStructuresListsArrays.ppt
09c-DataStructuresListsArrays.ppt09c-DataStructuresListsArrays.ppt
09c-DataStructuresListsArrays.ppt
 
Data Structures
Data StructuresData Structures
Data Structures
 
09c-DataStructuresListsArrays.ppt
09c-DataStructuresListsArrays.ppt09c-DataStructuresListsArrays.ppt
09c-DataStructuresListsArrays.ppt
 
data structures
data structuresdata structures
data structures
 
DATA-STRUCTURES.pptx
DATA-STRUCTURES.pptxDATA-STRUCTURES.pptx
DATA-STRUCTURES.pptx
 
UNIT I - Data Structures.pdf
UNIT I - Data Structures.pdfUNIT I - Data Structures.pdf
UNIT I - Data Structures.pdf
 
PPT_DATA STRUCTURE.ppt
PPT_DATA STRUCTURE.pptPPT_DATA STRUCTURE.ppt
PPT_DATA STRUCTURE.ppt
 
Data Structure Introduction chapter 1
Data Structure Introduction chapter 1Data Structure Introduction chapter 1
Data Structure Introduction chapter 1
 

Mais de Madishetty Prathibha

Mais de Madishetty Prathibha (14)

Object Oriented programming - Introduction
Object Oriented programming - IntroductionObject Oriented programming - Introduction
Object Oriented programming - Introduction
 
Access modifiers in java
Access modifiers in javaAccess modifiers in java
Access modifiers in java
 
Constructor in java
Constructor in javaConstructor in java
Constructor in java
 
Control statements in java
Control statements in javaControl statements in java
Control statements in java
 
Classes objects in java
Classes objects in javaClasses objects in java
Classes objects in java
 
Structure of java program diff c- cpp and java
Structure of java program  diff c- cpp and javaStructure of java program  diff c- cpp and java
Structure of java program diff c- cpp and java
 
Operators in java
Operators in javaOperators in java
Operators in java
 
Types of datastructures
Types of datastructuresTypes of datastructures
Types of datastructures
 
Introduction to algorithms
Introduction to algorithmsIntroduction to algorithms
Introduction to algorithms
 
Java data types, variables and jvm
Java data types, variables and jvm Java data types, variables and jvm
Java data types, variables and jvm
 
Java Tokens
Java  TokensJava  Tokens
Java Tokens
 
Oops concepts || Object Oriented Programming Concepts in Java
Oops concepts || Object Oriented Programming Concepts in JavaOops concepts || Object Oriented Programming Concepts in Java
Oops concepts || Object Oriented Programming Concepts in Java
 
Java features
Java  features Java  features
Java features
 
Introduction of java
Introduction  of javaIntroduction  of java
Introduction of java
 

Último

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
MateoGardella
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
MateoGardella
 

Último (20)

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 

Introduction to data structures (ss)

  • 2. Topics Definitions Introduction to Data structures Classification of Data structures
  • 3. Data: • Collection of raw facts. • Data are simply a value are set of values of different type which is called data types like string, integer, char etc. Structure: Way of organizing information, so that it is easier to use. Data structure is • representation of the logical relationship existing between individual elements of data. • a specialized format for organizing and storing data in memory that considers not only the elements stored but also their relationship to each other. • about structuring or arranging and storing of data in such a way so that it can be accessed and used efficiently. Definition
  • 4.  Data structure affects the design of both structural & functional aspects o f a program. Program = algorithm + Data Structure  We know that a algorithm is a step by step procedure to solve a particula r function.  That means, algorithm is a set of instruction written to carry out certain tasks & the data structure is the way of organizing the data with their logical relationship retained.  To develop a program of an algorithm, we should select an appropriate data structure for that algorithm. Therefore algorithm and its associated data structures form a program. INTRODUCTION
  • 5. Why Data Structure  Human requirement with computer are going to complex day by day.  To solve the complex requirements in efficient way we n eed this  Provide fastest solution of human requirements.  Provide efficient solution of complex problem. – Space – Time  Data structures are the ways of organizing and storing d ata in a computer so that we can perform several o perations efficiently on it.  It is widely used in every aspect of computer science.
  • 6. The main idea behind Data structure is to  reduces the memory usage of a Data Structure operation i.e., space complexity  reduces the execution time of operations on Data Structure i.e., the time complexity Data Structures Study Covers:  Amount of memory require to store  Amount of time require to process  Representation of data in memory  Operatins performed on that data
  • 7. As applications are getting complexed and amount of data is increasing day by day, there may arrise the following problems: Processor speed: To handle very large amout of data, high speed processing is required, but as the data is growing day by day to the billions of files per entity, processor may fail to deal with that much amount of data. Data Search: Consider an inventory size of 120 items in a store, If our application needs to search for a particular item, it needs to traverse 120 items every time, results 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 chances that a very large server can be failed during that process In order to solve the above problems, data structures are used. Need of Data Structures
  • 8. Efficiency: Efficiency of a program depends upon the choice of data st ructures. For example: suppose, we have some data and we need to perform the search for a perticular record. In that case, if we organize our data in an array, we will have to search sequentially element by element. hence, using array may not be very efficient here. There are better data structures which can make the search process efficient like ordered array, binary search tree or hash tables. Reusability: Data structures are reusable, i.e. once we have implemented a p articular data structure, we can use it at any other place. Abstraction: Data structure is specified by the ADT which provides a level of abstraction. The client program uses the data structure through interface on ly, without getting into the implementation details. Advantages of Data Structures
  • 9.
  • 10. Primitive Data Structure  These are basic structures and directly operated upon by the machine instructions.  Data structures that are directly operated upon the machine-level instructions are known as primitive data structures.  Primitive data structures have different representation s on different computers.  Integer, Floating-point number, Character constants, string constants, pointers etc, fall in this category.  The most commonly used operation on data structure are broadly categorized into : ◦ Create ◦ Selection ◦ Updating ◦ Destroy or Delete
  • 11.  These are more sophisticated data structures.  These are derived from primitive data structures.  The non-primitive data structures emphasize on structuring of a group of homogeneous (same type) or heterogeneous (different type) data items.  Lists, Stack, Queue, Tree, Graph are example of non-primitive data structures.  The most commonly used operation on data structure are broadly categorized into following types: • Create • Selection • Updating • Searching • Sorting • Merging • Destroy or Delete
  • 12. Linear Data structures:  Linear Data structures are kind of data structure that has homogeneous elements.  A data structure is called linear if all of its elements are arranged in the linear o rder.  In linear data structures, the elements are stored in non-hierarchical way wher e each element has the successors and predecessors except the first and last element.  The data structure in which elements are in a sequence and form a liner series.  Linear data structures are very easy to implement, since the memory of the computer is also organized in a linear fashion.  Some commonly used linear data structures are Stack, Queue and Linked Lists  There are two ways to represent a linear data structure in memory.  Static memory allocation  Dynamic memory allocation
  • 13. Arrays: An array is a collection of similar type of data items and each data item is called an element of the array. • The data type of the element may be any valid data type 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, two dimensional or multidimensional. • The individual elements of the array age are: age[0], age[1], age[2], age[3],......... age[98], age[99]. Types of Linear Data Structures
  • 14. Linked List: Linked list is a linear data structure 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. • In simple words, a linked list consists of nodes where each node contains a data field and a reference(link) to the next node in the list.
  • 15. Stack: Stack is a linear list in which insertion and deletions are allowed only at one end, called top. • A stack is an abstract data type (ADT), 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. • Stack is a linear data structure which follows a particular order in which the operations are performed. • The order may be LIFO(Last In First Out) or FILO(First In Last Out).
  • 16. 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 it ems.
  • 17. ◦ A Non-Linear Data structures is a data structure in w hich data item is connected to several other data i tems. ◦ Non-Linear data structure may exhibit either a hi erarchical relationship or parent child re lationship. ◦ The data elements are not arranged in a sequential st ructure. ◦ The different non-linear data structures are trees a nd graphs Non-Linear Data structures:
  • 18. Trees: Trees are multilevel data structures with a hierarchical relationship among its elements known as nodes. • The bottommost nodes in the herierchy are called leaf node • while the topmost node is called root node. • Each node contains pointers to point adjacent nodes. • Tree data structure is 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 atmost one parent except the root node. • Trees can be classfied into many categories Types of Non Linear Data Structures
  • 19. Graphs: Graphs can be defined as the pictorial representation of the set of elements (represented by vertices) connected by the links known as edges. • A Graph is a non-linear data structure consisting of nodes and edges. • The nodes are sometimes also referred to as vertices and the edges are lines or arcs that connect any two nodes in the graph. • More formally a Graph can be defined as, A Graph consists of a finite set of vertices(or nodes) and set of Edges which c onnect a pair of nodes. • A graph is different from tree in the sense that a graph can have cycle while the tree can not have the one.
  • 20.  Introduction to Data structures  Classification of Data structures Summary