SlideShare a Scribd company logo
Data Structure # vpmp polytechnic
INTRODUCTION DATASTRUCTURE
What is Data Structure?
•Data Structure: Data structure is a way to storing and organizing data in a computer
so that it can be used efficiently.
•Data structure is used in almost all program and software system.
•Data structure usually consist of two things:
1. The type of structure that we are going to use stores the data.
2. How efficiently we perform operations onto that data stored in structure so we
can reduce execution time and amount of memory space.
lavparmar.blogspot
Data and Information.
•Data: - Data is a collection of raw facts(or information) and it may or may not be
meaningful.
•Information: - meaningful data is known as Information.
•Example:
Program- set of instruction.
67.8- Weight of person.
13/3/1999- Date of birth of a person.
Define following terms:
(a) Cell:
•The smallest fundamental structural unit which represents a data entity.
•Cell is a memory location which stores elements of data items.
(b) Field: Field is used to store particular kind of data.
(c) Record: a record is a collection of related data items.
For example: Employee details
lavparmar.blogspot
Types of Data Structure
lavparmar.blogspot
 Primitive Data Structure:
•The Data structures that are directly processed by machine using its instructions are
known as primitive data structure.
•Following are the primitive data structure:
Integer:
•Integer represents numerical values which are whole quantities.
•The number of objects are countable can be represented by an integer.
•The set of integer is:{…..-(n+1), -n , ….. , -2, -1,0,1,2,………n,n+1}
•The sign and magnitude method is used to represent integer numbers. In this
method place a sign symbol in front of the number.
•Ex: 1000
lavparmar.blogspot
Real:
(a)The number having fractional part i.e decimal point is called real number.
(b)Common way of representing real number is normalized floating point
representation.
(c)In this method the real number is expressed as a combination of mantissa and
exponent.
(d)Ex: 123.45
Character:
•Character data structure is used to store nonnumeric information.
•It can be letters [A-Z], [a-z], operators and special symbols.
•A character is represented in memory as a sequence bits.
•Two most commonly known character set supported by computer are ASCII and EBCDIC.
Logical:
•A logical data item is a primitive data structure that can assume the values of either “true” or
“false”.
•Most commonly used logical operators Are AND, OR and NOT.
Pointer:
•Pointer is a variable which points to the memory address. This memory address is the
location of other variable in memory.
•It provides homogeneous method of referencing any data structure, regardless of the
structure’s type or complexity.
•Another characteristic is that it provides faster insertion and deletion of elements.
lavparmar.blogspot
 Non Primitive Data Structure:
•The data structures that are not directly processed by machine using its
instructions are known as non primitive data structure.
•Following are the non primitive data structure:
Array:
•Array is an ordered set which consist of a fixed number of object.
•Insertion and deletion operation can be performed on array.
•We can only change the value of the element in array.
List:
•List is an ordered set which consist of variable number of elements or object.
•Insertion and deletion can be performed on list.
File:
•A file is a large list that is stored in the external memory of computer.
•A file may be used as a repository for list items commonly called records.
lavparmar.blogspot
•Non Primitive Data Structure is classified into two categories:
Non linear Data structureLinear Data structure
lavparmar.blogspot
 Linear and Non Linear data structure.
Linear Data Structure:
• In the linear data structure processing of data items is possible in
linear fashion.
• Data are processed one by one sequentially.
• Examples of the linear data structure are:
(A) Array (B) Stack (C) Queue (D) Linked List
(A) Array: Array is an ordered set which consist of a fixed number
of object.
(B) Stack: A stack is a linier list in which insertion and
deletion operations are performed at only one
end of the list.
lavparmar.blogspot
(C) Queue: A queue is a linier list in which insertion is performed at one end called rear
and deletion is performed at another end of the list called front.
(D) Linked list: A linked list is a collection of nodes.
Each node has two fields:
(1) Information
(2) Address, which contains the address of the next node.
lavparmar.blogspot
Non Linear data structure:
In the Non linier data structure processing of data items is not possible in linier
fashion.
Examples of the non linier data structure are:
(A)Tree (B) Graph
(A) Tree: In tree data contains hierarchical relationship
BSPP
CE EC IT
Delhi Bomba
y
(B) Graph: this data structure contains relationship between pairs of elements.
Delhi Bombay
Calcutta Madras
lavparmar.blogspot
1.Operations on Data Structure:
•Traversing: Access each element of the data structure and doing some processing over
the data.
•Inserting: Insertion of new elements into the data structure.
•Deleting: Deletion of specific elements.
•Searching: Searching for a specific element.
•Sorting: Sorting the data in ascending or descending ordered.
•Merging: Combination of two data structure.
lavparmar.blogspot
1.Algorithms:
•Algorithm is a stepwise solution to a problem.
•Algorithm is a finite set of instructions that is followed to accomplish a particular task.
•In mathematics and computing, an algorithm is a procedure for accomplishing some task
which will terminate in a defined end-state.
•The computational complexity and efficient implementation of the algorithm are
important in computing, and this depends on suitable data structure.
lavparmar.blogspot
•Example:
Write Algorithm to compute the average of n elements.
Steps:
ALGORITHM: FIND AVERAGE OF N NUMBER
Assume that array contains n integer values.
•[INITIALIZE] sum ←0.
•[PERFORM SUM OPERATION]
Repeat steps from i=0 to n-1
sum←sum+a[i]
•[CALCULATE AVERAGE]
avg←sum/n
•Write avg
•[FINISHED]
Exit
lavparmar.blogspot
•Properties required for algorithm.
•Finiteness: “An algorithm must always terminate after a finite number of steps”.
•Definiteness: “Each steps of algorithm must be precisely defined”.
•Input: “quantities which are given to it initially before the algorithm begins”.
•Output: “quantities which have a specified relation to the input”.
•Effectiveness: “all the operations to be performed in the algorithm must be
sufficient”.
lavparmar.blogspot
lavparmar.blogspot
List Array
(1) No. of elements in a list are not fixed
(variable).(Dynamic Data structure)
(1) No. of elements in an array is fixed.
(Static Data structure)
(2)It uses pointer variable which occupies an
extra memory space.
(2) It does not use pointer variable so it does
not occupies extra memory space.
(3) Insertion and deletion operation are very
easy to perform.
(3) Insertion and deletion operation are very
difficult to perform.
(4) There are two types of List:
1. Linear List
2. Non Linear List
(4) There are two types of array:
1. One dimensional array
2. Two dimensional array
(5) Searching is slower in case of List. (5) Searching is faster in case of array.
Difference between List and Array
Static Memory Allocation Dynamic Memory Allocation
(1) Static Memory Allocation is Performed at
Compile Time.
(1) Dynamic Memory Allocation is
Performed at Runtime.
(2) In Static Memory Allocation Memory may
be wasted.
(2) In Dynamic Memory Allocation memory
is allocated when it is needed. So there is no
wastage of memory.
(3) Array is an example of static memory
allocation.
(3) Linked List is an example of dynamic
memory allocation. We can use malloc ()
function to allocate memory at runtime.
(4) In static memory allocation memory is
allocated sequentially.
(4) In dynamic memory allocation memory is
not allocated sequentially.
Difference between Static Memory allocation and Dynamic Memory allocation.
lavparmar.blogspot
FOR MORE DETAILS
EDUCATION MATERIAL , BOOKS , SOFTWARE
VISIT TO OUR BLOG : LAVPARMAR.BLOGSPOT.IN
VPMPROCKS.BLOGSPOT.IN
BADSHAH-COLLECTION.BLOGSPOT.IN
CE10.GUJ.BZ

More Related Content

What's hot (20)

PPTX
Data Structures - Lecture 2 [Introduction to Data Structures]
Muhammad Hammad Waseem
 
PPTX
Introduction to data structure ppt
NalinNishant3
 
PPTX
introduction to Data Structure and classification
chauhankapil
 
PPTX
Introduction of Data Structure
Mandavi Classes
 
PPTX
Types Of Data Structure
Vaishali Chinchkhede
 
PDF
Introduction to data structure
Zaid Shabbir
 
PPTX
Introduction to Data Structures
Amar Jukuntla
 
PPTX
DATA STRUCTURE
Rohit Rai
 
PPT
Chapter 1( intro & overview)
MUHAMMAD AAMIR
 
PPTX
Introduction To Data Structures.
Education Front
 
PPT
data structure
hashim102
 
PPTX
Introduction to Data Structure part 1
ProfSonaliGholveDoif
 
PPTX
Presentation on Data Structure
A. N. M. Jubaer
 
PPTX
Introduction to data structure
sunilchute1
 
PPTX
Introduction to Data Structures
nayanbanik
 
PPT
Introductiont To Aray,Tree,Stack, Queue
Ghaffar Khan
 
PPTX
Data structures Lecture no.3
AzharIqbal710687
 
PPTX
Data structures Lecture no. 2
AzharIqbal710687
 
PPTX
Data structures lectures no 1
AzharIqbal710687
 
PDF
Files and data storage
Zaid Shabbir
 
Data Structures - Lecture 2 [Introduction to Data Structures]
Muhammad Hammad Waseem
 
Introduction to data structure ppt
NalinNishant3
 
introduction to Data Structure and classification
chauhankapil
 
Introduction of Data Structure
Mandavi Classes
 
Types Of Data Structure
Vaishali Chinchkhede
 
Introduction to data structure
Zaid Shabbir
 
Introduction to Data Structures
Amar Jukuntla
 
DATA STRUCTURE
Rohit Rai
 
Chapter 1( intro & overview)
MUHAMMAD AAMIR
 
Introduction To Data Structures.
Education Front
 
data structure
hashim102
 
Introduction to Data Structure part 1
ProfSonaliGholveDoif
 
Presentation on Data Structure
A. N. M. Jubaer
 
Introduction to data structure
sunilchute1
 
Introduction to Data Structures
nayanbanik
 
Introductiont To Aray,Tree,Stack, Queue
Ghaffar Khan
 
Data structures Lecture no.3
AzharIqbal710687
 
Data structures Lecture no. 2
AzharIqbal710687
 
Data structures lectures no 1
AzharIqbal710687
 
Files and data storage
Zaid Shabbir
 

Similar to Data Structure # vpmp polytechnic (20)

PPTX
DataStructureccvdgddfffdesddsssdssPpt.pptx
bgmi52926
 
PPTX
DataStructurePpt.pptx
ssuser031f35
 
PPTX
ntroduction of Algorithms, Analysing Algorithms. Arrays: Sparse Matrices - Re...
kalaip3
 
PPTX
DataStructurePpt-01.pptxEngineering data structure notes
limev72215
 
PPTX
DataStructurePpt.pptx
DCABCA
 
PPTX
Unit-1 DataStructure Intro.pptx
ajajkhan16
 
PDF
Data Structure Ppt for our engineering college industrial training.
AnumaiAshish
 
PPTX
Introduction to Data Structure
chouguleamruta24
 
PPTX
Introduction to Data Structures and their importance
Bulbul Agrawal
 
PPTX
UNIT 3.pptx-Data Structures definition with examples
Papitha7
 
PDF
Unit-I PPT hususi sisooshsgv. Eijeieieooekejj
sanketkurve7
 
PPTX
DSA - Copy.pptx
BishalChowdhury10
 
PPTX
Introduction to data structures (ss)
Madishetty Prathibha
 
PDF
Data Structures & Recursion-Introduction.pdf
MaryJacob24
 
PPTX
Different types of sorting used in programming.pptx
aadithyaaa2005
 
PDF
DATA STRUCTURE BY SIVASANKARI
SivaSankari36
 
PPT
DATA STRUCTURE AND ALGORITHMS
removed_8057d320f6c8601c14a895598b86eacb
 
PDF
Unit 1-Introduction to Data Structures-BCA.pdf
MaryJacob24
 
PDF
Data Structures & algorithms kdkdkakdkadkd
Anji (M.Tech)
 
PPT
Unit 1.ppt
Minakshee Patil
 
DataStructureccvdgddfffdesddsssdssPpt.pptx
bgmi52926
 
DataStructurePpt.pptx
ssuser031f35
 
ntroduction of Algorithms, Analysing Algorithms. Arrays: Sparse Matrices - Re...
kalaip3
 
DataStructurePpt-01.pptxEngineering data structure notes
limev72215
 
DataStructurePpt.pptx
DCABCA
 
Unit-1 DataStructure Intro.pptx
ajajkhan16
 
Data Structure Ppt for our engineering college industrial training.
AnumaiAshish
 
Introduction to Data Structure
chouguleamruta24
 
Introduction to Data Structures and their importance
Bulbul Agrawal
 
UNIT 3.pptx-Data Structures definition with examples
Papitha7
 
Unit-I PPT hususi sisooshsgv. Eijeieieooekejj
sanketkurve7
 
DSA - Copy.pptx
BishalChowdhury10
 
Introduction to data structures (ss)
Madishetty Prathibha
 
Data Structures & Recursion-Introduction.pdf
MaryJacob24
 
Different types of sorting used in programming.pptx
aadithyaaa2005
 
DATA STRUCTURE BY SIVASANKARI
SivaSankari36
 
DATA STRUCTURE AND ALGORITHMS
removed_8057d320f6c8601c14a895598b86eacb
 
Unit 1-Introduction to Data Structures-BCA.pdf
MaryJacob24
 
Data Structures & algorithms kdkdkakdkadkd
Anji (M.Tech)
 
Unit 1.ppt
Minakshee Patil
 
Ad

Recently uploaded (20)

PDF
Our Guide to the July 2025 USPS® Rate Change
Postal Advocate Inc.
 
PDF
IMPORTANT GUIDELINES FOR M.Sc.ZOOLOGY DISSERTATION
raviralanaresh2
 
PDF
Free eBook ~100 Common English Proverbs (ebook) pdf.pdf
OH TEIK BIN
 
PPTX
Connecting Linear and Angular Quantities in Human Movement.pptx
AngeliqueTolentinoDe
 
PPTX
Aerobic and Anaerobic respiration and CPR.pptx
Olivier Rochester
 
PPTX
PLANNING FOR EMERGENCY AND DISASTER MANAGEMENT ppt.pptx
PRADEEP ABOTHU
 
PPTX
grade 8 week 2 ict.pptx. matatag grade 7
VanessaTaberlo
 
PPTX
How to Create & Manage Stages in Odoo 18 Helpdesk
Celine George
 
PPTX
How to Add a Custom Button in Odoo 18 POS Screen
Celine George
 
PDF
CAD25 Gbadago and Fafa Presentation Revised-Aston Business School, UK.pdf
Kweku Zurek
 
PPTX
Nitrogen rule, ring rule, mc lafferty.pptx
nbisen2001
 
PDF
Nanotechnology and Functional Foods Effective Delivery of Bioactive Ingredien...
rmswlwcxai8321
 
PDF
TLE 8 QUARTER 1 MODULE WEEK 1 MATATAG CURRICULUM
denniseraya1997
 
PPTX
How to Configure Taxes in Company Currency in Odoo 18 Accounting
Celine George
 
PPTX
Exploring Linear and Angular Quantities and Ergonomic Design.pptx
AngeliqueTolentinoDe
 
PPTX
The Gift of the Magi by O Henry-A Story of True Love, Sacrifice, and Selfless...
Beena E S
 
PPTX
Life and Career Skills Lesson 2.pptxProtective and Risk Factors of Late Adole...
ryangabrielcatalon40
 
PDF
Indian National movement PPT by Simanchala Sarab, Covering The INC(Formation,...
Simanchala Sarab, BABed(ITEP Secondary stage) in History student at GNDU Amritsar
 
PDF
Cooperative wireless communications 1st Edition Yan Zhang
jsphyftmkb123
 
PPTX
Elo the Hero is an story about a young boy who became hero.
TeacherEmily1
 
Our Guide to the July 2025 USPS® Rate Change
Postal Advocate Inc.
 
IMPORTANT GUIDELINES FOR M.Sc.ZOOLOGY DISSERTATION
raviralanaresh2
 
Free eBook ~100 Common English Proverbs (ebook) pdf.pdf
OH TEIK BIN
 
Connecting Linear and Angular Quantities in Human Movement.pptx
AngeliqueTolentinoDe
 
Aerobic and Anaerobic respiration and CPR.pptx
Olivier Rochester
 
PLANNING FOR EMERGENCY AND DISASTER MANAGEMENT ppt.pptx
PRADEEP ABOTHU
 
grade 8 week 2 ict.pptx. matatag grade 7
VanessaTaberlo
 
How to Create & Manage Stages in Odoo 18 Helpdesk
Celine George
 
How to Add a Custom Button in Odoo 18 POS Screen
Celine George
 
CAD25 Gbadago and Fafa Presentation Revised-Aston Business School, UK.pdf
Kweku Zurek
 
Nitrogen rule, ring rule, mc lafferty.pptx
nbisen2001
 
Nanotechnology and Functional Foods Effective Delivery of Bioactive Ingredien...
rmswlwcxai8321
 
TLE 8 QUARTER 1 MODULE WEEK 1 MATATAG CURRICULUM
denniseraya1997
 
How to Configure Taxes in Company Currency in Odoo 18 Accounting
Celine George
 
Exploring Linear and Angular Quantities and Ergonomic Design.pptx
AngeliqueTolentinoDe
 
The Gift of the Magi by O Henry-A Story of True Love, Sacrifice, and Selfless...
Beena E S
 
Life and Career Skills Lesson 2.pptxProtective and Risk Factors of Late Adole...
ryangabrielcatalon40
 
Indian National movement PPT by Simanchala Sarab, Covering The INC(Formation,...
Simanchala Sarab, BABed(ITEP Secondary stage) in History student at GNDU Amritsar
 
Cooperative wireless communications 1st Edition Yan Zhang
jsphyftmkb123
 
Elo the Hero is an story about a young boy who became hero.
TeacherEmily1
 
Ad

Data Structure # vpmp polytechnic

  • 2. INTRODUCTION DATASTRUCTURE What is Data Structure? •Data Structure: Data structure is a way to storing and organizing data in a computer so that it can be used efficiently. •Data structure is used in almost all program and software system. •Data structure usually consist of two things: 1. The type of structure that we are going to use stores the data. 2. How efficiently we perform operations onto that data stored in structure so we can reduce execution time and amount of memory space. lavparmar.blogspot
  • 3. Data and Information. •Data: - Data is a collection of raw facts(or information) and it may or may not be meaningful. •Information: - meaningful data is known as Information. •Example: Program- set of instruction. 67.8- Weight of person. 13/3/1999- Date of birth of a person. Define following terms: (a) Cell: •The smallest fundamental structural unit which represents a data entity. •Cell is a memory location which stores elements of data items. (b) Field: Field is used to store particular kind of data. (c) Record: a record is a collection of related data items. For example: Employee details lavparmar.blogspot
  • 4. Types of Data Structure lavparmar.blogspot
  • 5.  Primitive Data Structure: •The Data structures that are directly processed by machine using its instructions are known as primitive data structure. •Following are the primitive data structure: Integer: •Integer represents numerical values which are whole quantities. •The number of objects are countable can be represented by an integer. •The set of integer is:{…..-(n+1), -n , ….. , -2, -1,0,1,2,………n,n+1} •The sign and magnitude method is used to represent integer numbers. In this method place a sign symbol in front of the number. •Ex: 1000 lavparmar.blogspot
  • 6. Real: (a)The number having fractional part i.e decimal point is called real number. (b)Common way of representing real number is normalized floating point representation. (c)In this method the real number is expressed as a combination of mantissa and exponent. (d)Ex: 123.45 Character: •Character data structure is used to store nonnumeric information. •It can be letters [A-Z], [a-z], operators and special symbols. •A character is represented in memory as a sequence bits. •Two most commonly known character set supported by computer are ASCII and EBCDIC. Logical: •A logical data item is a primitive data structure that can assume the values of either “true” or “false”. •Most commonly used logical operators Are AND, OR and NOT. Pointer: •Pointer is a variable which points to the memory address. This memory address is the location of other variable in memory. •It provides homogeneous method of referencing any data structure, regardless of the structure’s type or complexity. •Another characteristic is that it provides faster insertion and deletion of elements. lavparmar.blogspot
  • 7.  Non Primitive Data Structure: •The data structures that are not directly processed by machine using its instructions are known as non primitive data structure. •Following are the non primitive data structure: Array: •Array is an ordered set which consist of a fixed number of object. •Insertion and deletion operation can be performed on array. •We can only change the value of the element in array. List: •List is an ordered set which consist of variable number of elements or object. •Insertion and deletion can be performed on list. File: •A file is a large list that is stored in the external memory of computer. •A file may be used as a repository for list items commonly called records. lavparmar.blogspot
  • 8. •Non Primitive Data Structure is classified into two categories: Non linear Data structureLinear Data structure lavparmar.blogspot
  • 9.  Linear and Non Linear data structure. Linear Data Structure: • In the linear data structure processing of data items is possible in linear fashion. • Data are processed one by one sequentially. • Examples of the linear data structure are: (A) Array (B) Stack (C) Queue (D) Linked List (A) Array: Array is an ordered set which consist of a fixed number of object. (B) Stack: A stack is a linier list in which insertion and deletion operations are performed at only one end of the list. lavparmar.blogspot
  • 10. (C) Queue: A queue is a linier list in which insertion is performed at one end called rear and deletion is performed at another end of the list called front. (D) Linked list: A linked list is a collection of nodes. Each node has two fields: (1) Information (2) Address, which contains the address of the next node. lavparmar.blogspot
  • 11. Non Linear data structure: In the Non linier data structure processing of data items is not possible in linier fashion. Examples of the non linier data structure are: (A)Tree (B) Graph (A) Tree: In tree data contains hierarchical relationship BSPP CE EC IT Delhi Bomba y (B) Graph: this data structure contains relationship between pairs of elements. Delhi Bombay Calcutta Madras lavparmar.blogspot
  • 12. 1.Operations on Data Structure: •Traversing: Access each element of the data structure and doing some processing over the data. •Inserting: Insertion of new elements into the data structure. •Deleting: Deletion of specific elements. •Searching: Searching for a specific element. •Sorting: Sorting the data in ascending or descending ordered. •Merging: Combination of two data structure. lavparmar.blogspot
  • 13. 1.Algorithms: •Algorithm is a stepwise solution to a problem. •Algorithm is a finite set of instructions that is followed to accomplish a particular task. •In mathematics and computing, an algorithm is a procedure for accomplishing some task which will terminate in a defined end-state. •The computational complexity and efficient implementation of the algorithm are important in computing, and this depends on suitable data structure. lavparmar.blogspot
  • 14. •Example: Write Algorithm to compute the average of n elements. Steps: ALGORITHM: FIND AVERAGE OF N NUMBER Assume that array contains n integer values. •[INITIALIZE] sum ←0. •[PERFORM SUM OPERATION] Repeat steps from i=0 to n-1 sum←sum+a[i] •[CALCULATE AVERAGE] avg←sum/n •Write avg •[FINISHED] Exit lavparmar.blogspot
  • 15. •Properties required for algorithm. •Finiteness: “An algorithm must always terminate after a finite number of steps”. •Definiteness: “Each steps of algorithm must be precisely defined”. •Input: “quantities which are given to it initially before the algorithm begins”. •Output: “quantities which have a specified relation to the input”. •Effectiveness: “all the operations to be performed in the algorithm must be sufficient”. lavparmar.blogspot
  • 16. lavparmar.blogspot List Array (1) No. of elements in a list are not fixed (variable).(Dynamic Data structure) (1) No. of elements in an array is fixed. (Static Data structure) (2)It uses pointer variable which occupies an extra memory space. (2) It does not use pointer variable so it does not occupies extra memory space. (3) Insertion and deletion operation are very easy to perform. (3) Insertion and deletion operation are very difficult to perform. (4) There are two types of List: 1. Linear List 2. Non Linear List (4) There are two types of array: 1. One dimensional array 2. Two dimensional array (5) Searching is slower in case of List. (5) Searching is faster in case of array. Difference between List and Array
  • 17. Static Memory Allocation Dynamic Memory Allocation (1) Static Memory Allocation is Performed at Compile Time. (1) Dynamic Memory Allocation is Performed at Runtime. (2) In Static Memory Allocation Memory may be wasted. (2) In Dynamic Memory Allocation memory is allocated when it is needed. So there is no wastage of memory. (3) Array is an example of static memory allocation. (3) Linked List is an example of dynamic memory allocation. We can use malloc () function to allocate memory at runtime. (4) In static memory allocation memory is allocated sequentially. (4) In dynamic memory allocation memory is not allocated sequentially. Difference between Static Memory allocation and Dynamic Memory allocation. lavparmar.blogspot
  • 18. FOR MORE DETAILS EDUCATION MATERIAL , BOOKS , SOFTWARE VISIT TO OUR BLOG : LAVPARMAR.BLOGSPOT.IN VPMPROCKS.BLOGSPOT.IN BADSHAH-COLLECTION.BLOGSPOT.IN CE10.GUJ.BZ