SlideShare a Scribd company logo
 Data : simply a value of some data type like integer,
character etc.
 Structure: way of organizing or storing data
 Data structure is a way of organizing all data items
that considers not only the elements stored but also
their relationship to each other.
 Program=algorithm + Data Structure
 You know that a algorithm is a step by step procedure
to solve a particular 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
from a program.
 Data structure are normally divided into two broad
categories:
◦ Primitive Data Structure
◦ Non-Primitive Data Structure
Data structure
Primitive DS Non-Primitive DS
Integer Float Character Pointer
Float
Integer Float
Non-Primitive DS
Linear List Non-Linear List
Array
Link List Stack
Queue Graph Trees
 There are basic structures and directly operated upon
by the machine instructions.
 In general, there are different representation on
different computers.
 Integer, Floating-point number, Character constants,
string constants, pointers etc, fall in this category.
 There are more sophisticated data structures.
 These are derived from the 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 design of an efficient data structure must take
operations to be performed on the data structure.
 The most commonly used operation on data
structure are broadly categorized into following
types:
◦ Create
◦ Selection
◦ Updating
◦ Searching
◦ Sorting
◦ Merging
◦ Destroy or Delete
 A primitive data structure is generally a basic structure
that is usually built into the language, such as an
integer, a float.
 A non-primitive data structure is built out of primitive
data structures linked together in meaningful ways,
such as a or a linked-list, binary search tree, AVL Tree,
graph etc.
 An array is defined as a set of finite number of
homogeneous elements or same data items.
 It means an array can contain one type of data only,
either all integer, all float-point number or all
character.
 Simply, declaration of array is as follows:
int arr[10]
 Where int specifies the data type or type of elements
arrays stores.
 “arr” is the name of array & the number specified
inside the square brackets is the number of elements
an array can store, this is also called sized or length
of array.
 Following are some of the concepts to be remembered
about arrays:
◦ The individual element of an array can be
accessed by specifying name of the array,
following by index or subscript inside square
brackets.
◦ The first element of the array has index
zero[0]. It means the first element and last
element will be specified as:arr[0] & arr[9]
Respectively.
◦ The elements of array will always be stored
in the consecutive (continues) memory
location.
◦ The number of elements that can be stored
in an array, that is the size of array or its
length is given by the following equation:
(Upperbound-lowerbound)+1
◦ For the above array it would be
(9-0)+1=10,where 0 is the lower bound of
array and 9 is the upper bound of array.
◦ Array can always be read or written through
loop. If we read a one-dimensional array it
require one loop for reading and other for
writing the array.
◦ For example: Reading an array
For(i=0;i<=9;i++)
scanf(“%d”,&arr[i]);
◦ For example: Writing an array
For(i=0;i<=9;i++)
printf(“%d”,arr[i]);
◦ If we are reading or writing two-dimensional
array it would require two loops. And
similarly the array of a N dimension would
required N loops.
◦ Some common operation performed on array
are:
 Creation of an array
 Traversing an array
◦ Insertion of new element
◦ Deletion of required element
◦ Modification of an element
◦ Merging of arrays
 A lists (Linear linked list) can be defined as a
collection of variable number of data items.
 Lists are the most commonly used non-primitive data
structures.
 An element of list must contain at least two fields, one
for storing data or information and other for storing
address of next element.
 As you know for storing address we have a special data
structure of list the address must be pointer type.
 Technically each such element is referred to as a node,
therefore a list can be defined as a collection of nodes
as show bellow:
Head
AAA BBB CCC
Information field Pointer field
[Linear Liked List]
 Types of linked lists:
◦ Single linked list
◦ Doubly linked list
◦ Single circular linked list
◦ Doubly circular linked list
 A stack is also an ordered collection of elements like
arrays, but it has a special feature that deletion and
insertion of elements can be done only from one end
called the top of the stack (TOP)
 Due to this property it is also called as last in first out
type of data structure (LIFO).
 It could be through of just like a stack of plates placed on
table in a party, a guest always takes off a fresh plate
from the top and the new plates are placed on to the stack
at the top.
 It is a non-primitive data structure.
 When an element is inserted into a stack or removed
from the stack, its base remains fixed where the top of
stack changes.
 Insertion of element into stack is called PUSH and
deletion of element from stack is called POP.
 The bellow show figure how the operations take place
on a stack:
PUSH POP
[STACK]
 The stack can be implemented into two ways:
◦ Using arrays (Static implementation)
◦ Using pointer (Dynamic implementation)
 Queue are first in first out type of data structure (i.e.
FIFO)
 In a queue new elements are added to the queue from
one end called REAR end and the element are always
removed from other end called the FRONT end.
 The people standing in a railway reservation row are
an example of queue.
 Each new person comes and stands at the end of
the row and person getting their reservation
confirmed get out of the row from the front end.
 The bellow show figure how the operations take
place on a stack:
10 20 30 40 50
front rear
 The queue can be implemented into two ways:
◦ Using arrays (Static implementation)
◦ Using pointer (Dynamic implementation)
 A tree can be defined as finite set of data items (nodes).
 Tree is non-linear type of data structure in which data
items are arranged or stored in a sorted sequence.
 Tree represent the hierarchical relationship between
various elements.
 In trees:
 There is a special data item at the top of hierarchy
called the Root of the tree.
 The remaining data items are partitioned into number
of mutually exclusive subset, each of which is itself,
a tree which is called the sub tree.
 The tree always grows in length towards bottom in
data structures, unlike natural trees which grows
upwards.
 The tree structure organizes the data into branches,
which related the information.
A
B C
D E F G
root
 Graph is a mathematical non-linear data structure
capable of representing many kind of physical
structures.
 It has found application in Geography, Chemistry and
Engineering sciences.
 Definition: A graph G(V,E) is a set of vertices V and a
set of edges E.
 An edge connects a pair of vertices and many have
weight such as length, cost and another measuring
instrument for according the graph.
 Vertices on the graph are shown as point or circles and
edges are drawn as arcs or line segment.
 Example of graph:
v2
v1
v4
v5
v3
10
15
8
6
11
9
v4
v1
v2
v4
v3
[a] Directed &
Weighted Graph
[b] Undirected Graph
 Types of Graphs:
◦ Directed graph
◦ Undirected graph
◦ Simple graph
◦ Weighted graph
◦ Connected graph
◦ Non-connected graph

More Related Content

Similar to intr_ds.ppt

data structure in programing language.ppt
data structure in programing language.pptdata structure in programing language.ppt
data structure in programing language.ppt
LavkushGupta12
 
DS_PPT.ppt
DS_PPT.pptDS_PPT.ppt
DS_PPT.ppt
MeghaKulkarni27
 
Unit 1.ppt
Unit 1.pptUnit 1.ppt
Unit 1.ppt
Minakshee Patil
 
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
 
UNITIII LDS.pdf
UNITIII LDS.pdfUNITIII LDS.pdf
UNITIII LDS.pdf
meenamadhuvandhi2
 
Data Structure
Data Structure Data Structure
Data Structure
Ibrahim MH
 
Data structure ppt
Data structure pptData structure ppt
Data structure ppt
Prof. Dr. K. Adisesha
 
Which data structure is it? What are the various data structure kinds and wha...
Which data structure is it? What are the various data structure kinds and wha...Which data structure is it? What are the various data structure kinds and wha...
Which data structure is it? What are the various data structure kinds and wha...
Tutort Academy
 
Introduction to Data Structure
Introduction to Data StructureIntroduction to Data Structure
Introduction to Data StructureJazz Jinia Bhowmik
 
Data structures - Introduction
Data structures - IntroductionData structures - Introduction
Data structures - Introduction
DeepaThirumurugan
 
Data Structure
Data StructureData Structure
Data Structure
HarshGupta663
 
DS Module 1.pptx
DS Module 1.pptxDS Module 1.pptx
DS Module 1.pptx
SaralaT3
 
DS Module 1.pptx
DS Module 1.pptxDS Module 1.pptx
DS Module 1.pptx
sarala9
 
TSAT Presentation1.pptx
TSAT Presentation1.pptxTSAT Presentation1.pptx
TSAT Presentation1.pptx
Rajitha Reddy Alugati
 
Introduction to Data Structure
Introduction to Data StructureIntroduction to Data Structure
Introduction to Data Structure
chouguleamruta24
 
Data Structures and algoithms Unit - 1.pptx
Data Structures and algoithms Unit - 1.pptxData Structures and algoithms Unit - 1.pptx
Data Structures and algoithms Unit - 1.pptx
mexiuro901
 
DATA STRUCTURE IN C LANGUAGE
DATA STRUCTURE IN C LANGUAGEDATA STRUCTURE IN C LANGUAGE
DATA STRUCTURE IN C LANGUAGE
shubhamrohiwal6
 
Data structure
Data structureData structure
Data structure
Gaurav Handge
 
datastructureppt-190327174340 (1).pptx
datastructureppt-190327174340 (1).pptxdatastructureppt-190327174340 (1).pptx
datastructureppt-190327174340 (1).pptx
DEEPAK948083
 

Similar to intr_ds.ppt (20)

data structure in programing language.ppt
data structure in programing language.pptdata structure in programing language.ppt
data structure in programing language.ppt
 
DS_PPT.pptx
DS_PPT.pptxDS_PPT.pptx
DS_PPT.pptx
 
DS_PPT.ppt
DS_PPT.pptDS_PPT.ppt
DS_PPT.ppt
 
Unit 1.ppt
Unit 1.pptUnit 1.ppt
Unit 1.ppt
 
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
 
UNITIII LDS.pdf
UNITIII LDS.pdfUNITIII LDS.pdf
UNITIII LDS.pdf
 
Data Structure
Data Structure Data Structure
Data Structure
 
Data structure ppt
Data structure pptData structure ppt
Data structure ppt
 
Which data structure is it? What are the various data structure kinds and wha...
Which data structure is it? What are the various data structure kinds and wha...Which data structure is it? What are the various data structure kinds and wha...
Which data structure is it? What are the various data structure kinds and wha...
 
Introduction to Data Structure
Introduction to Data StructureIntroduction to Data Structure
Introduction to Data Structure
 
Data structures - Introduction
Data structures - IntroductionData structures - Introduction
Data structures - Introduction
 
Data Structure
Data StructureData Structure
Data Structure
 
DS Module 1.pptx
DS Module 1.pptxDS Module 1.pptx
DS Module 1.pptx
 
DS Module 1.pptx
DS Module 1.pptxDS Module 1.pptx
DS Module 1.pptx
 
TSAT Presentation1.pptx
TSAT Presentation1.pptxTSAT Presentation1.pptx
TSAT Presentation1.pptx
 
Introduction to Data Structure
Introduction to Data StructureIntroduction to Data Structure
Introduction to Data Structure
 
Data Structures and algoithms Unit - 1.pptx
Data Structures and algoithms Unit - 1.pptxData Structures and algoithms Unit - 1.pptx
Data Structures and algoithms Unit - 1.pptx
 
DATA STRUCTURE IN C LANGUAGE
DATA STRUCTURE IN C LANGUAGEDATA STRUCTURE IN C LANGUAGE
DATA STRUCTURE IN C LANGUAGE
 
Data structure
Data structureData structure
Data structure
 
datastructureppt-190327174340 (1).pptx
datastructureppt-190327174340 (1).pptxdatastructureppt-190327174340 (1).pptx
datastructureppt-190327174340 (1).pptx
 

Recently uploaded

Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Shahin Sheidaei
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
kalichargn70th171
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar
 
Strategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptxStrategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptx
varshanayak241
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
Cyanic lab
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
Tendenci - The Open Source AMS (Association Management Software)
 
Software Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdfSoftware Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdf
MayankTawar1
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
IES VE
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
Jelle | Nordend
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
Tier1 app
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
Globus
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 

Recently uploaded (20)

Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
 
Strategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptxStrategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptx
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
Software Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdfSoftware Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdf
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 

intr_ds.ppt

  • 1.
  • 2.  Data : simply a value of some data type like integer, character etc.  Structure: way of organizing or storing data  Data structure is a way of organizing all data items that considers not only the elements stored but also their relationship to each other.
  • 3.  Program=algorithm + Data Structure  You know that a algorithm is a step by step procedure to solve a particular function.
  • 4.  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 from a program.
  • 5.  Data structure are normally divided into two broad categories: ◦ Primitive Data Structure ◦ Non-Primitive Data Structure
  • 6. Data structure Primitive DS Non-Primitive DS Integer Float Character Pointer Float Integer Float
  • 7. Non-Primitive DS Linear List Non-Linear List Array Link List Stack Queue Graph Trees
  • 8.  There are basic structures and directly operated upon by the machine instructions.  In general, there are different representation on different computers.  Integer, Floating-point number, Character constants, string constants, pointers etc, fall in this category.
  • 9.  There are more sophisticated data structures.  These are derived from the primitive data structures.  The non-primitive data structures emphasize on structuring of a group of homogeneous (same type) or heterogeneous (different type) data items.
  • 10.  Lists, Stack, Queue, Tree, Graph are example of non- primitive data structures.  The design of an efficient data structure must take operations to be performed on the data structure.
  • 11.  The most commonly used operation on data structure are broadly categorized into following types: ◦ Create ◦ Selection ◦ Updating ◦ Searching ◦ Sorting ◦ Merging ◦ Destroy or Delete
  • 12.  A primitive data structure is generally a basic structure that is usually built into the language, such as an integer, a float.  A non-primitive data structure is built out of primitive data structures linked together in meaningful ways, such as a or a linked-list, binary search tree, AVL Tree, graph etc.
  • 13.  An array is defined as a set of finite number of homogeneous elements or same data items.  It means an array can contain one type of data only, either all integer, all float-point number or all character.
  • 14.  Simply, declaration of array is as follows: int arr[10]  Where int specifies the data type or type of elements arrays stores.  “arr” is the name of array & the number specified inside the square brackets is the number of elements an array can store, this is also called sized or length of array.
  • 15.  Following are some of the concepts to be remembered about arrays: ◦ The individual element of an array can be accessed by specifying name of the array, following by index or subscript inside square brackets. ◦ The first element of the array has index zero[0]. It means the first element and last element will be specified as:arr[0] & arr[9] Respectively.
  • 16. ◦ The elements of array will always be stored in the consecutive (continues) memory location. ◦ The number of elements that can be stored in an array, that is the size of array or its length is given by the following equation: (Upperbound-lowerbound)+1
  • 17. ◦ For the above array it would be (9-0)+1=10,where 0 is the lower bound of array and 9 is the upper bound of array. ◦ Array can always be read or written through loop. If we read a one-dimensional array it require one loop for reading and other for writing the array.
  • 18. ◦ For example: Reading an array For(i=0;i<=9;i++) scanf(“%d”,&arr[i]); ◦ For example: Writing an array For(i=0;i<=9;i++) printf(“%d”,arr[i]);
  • 19. ◦ If we are reading or writing two-dimensional array it would require two loops. And similarly the array of a N dimension would required N loops. ◦ Some common operation performed on array are:  Creation of an array  Traversing an array
  • 20. ◦ Insertion of new element ◦ Deletion of required element ◦ Modification of an element ◦ Merging of arrays
  • 21.  A lists (Linear linked list) can be defined as a collection of variable number of data items.  Lists are the most commonly used non-primitive data structures.  An element of list must contain at least two fields, one for storing data or information and other for storing address of next element.  As you know for storing address we have a special data structure of list the address must be pointer type.
  • 22.  Technically each such element is referred to as a node, therefore a list can be defined as a collection of nodes as show bellow: Head AAA BBB CCC Information field Pointer field [Linear Liked List]
  • 23.  Types of linked lists: ◦ Single linked list ◦ Doubly linked list ◦ Single circular linked list ◦ Doubly circular linked list
  • 24.  A stack is also an ordered collection of elements like arrays, but it has a special feature that deletion and insertion of elements can be done only from one end called the top of the stack (TOP)  Due to this property it is also called as last in first out type of data structure (LIFO).
  • 25.  It could be through of just like a stack of plates placed on table in a party, a guest always takes off a fresh plate from the top and the new plates are placed on to the stack at the top.  It is a non-primitive data structure.  When an element is inserted into a stack or removed from the stack, its base remains fixed where the top of stack changes.
  • 26.  Insertion of element into stack is called PUSH and deletion of element from stack is called POP.  The bellow show figure how the operations take place on a stack: PUSH POP [STACK]
  • 27.  The stack can be implemented into two ways: ◦ Using arrays (Static implementation) ◦ Using pointer (Dynamic implementation)
  • 28.  Queue are first in first out type of data structure (i.e. FIFO)  In a queue new elements are added to the queue from one end called REAR end and the element are always removed from other end called the FRONT end.  The people standing in a railway reservation row are an example of queue.
  • 29.  Each new person comes and stands at the end of the row and person getting their reservation confirmed get out of the row from the front end.  The bellow show figure how the operations take place on a stack: 10 20 30 40 50 front rear
  • 30.  The queue can be implemented into two ways: ◦ Using arrays (Static implementation) ◦ Using pointer (Dynamic implementation)
  • 31.  A tree can be defined as finite set of data items (nodes).  Tree is non-linear type of data structure in which data items are arranged or stored in a sorted sequence.  Tree represent the hierarchical relationship between various elements.
  • 32.  In trees:  There is a special data item at the top of hierarchy called the Root of the tree.  The remaining data items are partitioned into number of mutually exclusive subset, each of which is itself, a tree which is called the sub tree.  The tree always grows in length towards bottom in data structures, unlike natural trees which grows upwards.
  • 33.  The tree structure organizes the data into branches, which related the information. A B C D E F G root
  • 34.  Graph is a mathematical non-linear data structure capable of representing many kind of physical structures.  It has found application in Geography, Chemistry and Engineering sciences.  Definition: A graph G(V,E) is a set of vertices V and a set of edges E.
  • 35.  An edge connects a pair of vertices and many have weight such as length, cost and another measuring instrument for according the graph.  Vertices on the graph are shown as point or circles and edges are drawn as arcs or line segment.
  • 36.  Example of graph: v2 v1 v4 v5 v3 10 15 8 6 11 9 v4 v1 v2 v4 v3 [a] Directed & Weighted Graph [b] Undirected Graph
  • 37.  Types of Graphs: ◦ Directed graph ◦ Undirected graph ◦ Simple graph ◦ Weighted graph ◦ Connected graph ◦ Non-connected graph