SlideShare a Scribd company logo
Definitions 
What is Data Structure? 
“It is set of procedures to define, store, access and 
manipulate data” 
or 
“The organized collection of data is called data structure” 
or 
“The logical or mathematical model of a particular 
organization of data is called data structure”
Types of Data Structure 
• Physical Data Structures 
– The data structures that have actually or physically 
same space in memory are called physical data 
structures 
– For example, one dimensional array 
• Logical Data Structures 
– The data structures which are treated, defined 
and stored in their logical picture 
– For example, Boolean data type
Types of Data 
• Primitive 
• Non-primitive 
• Records and Files 
• Primitive(Elementary Data Types) 
– The data types which are processed or 
manipulated as a single whole(i.e, alone) 
– Example, integer, real, charater etc. 
– They are also called built-in data types
Types of Data 
• Non-Primitive(Structure Data Types) 
– The items which are collection of other data 
structures are called non-primitive items. 
– If more than one values are combined in the 
single name is called non-primitive data structures 
– Example, Arrays, Stack, Queues etc. 
• Types of non-Primitive Data Structures 
– Linear 
– Non-Linear
Linear Data Structures 
The DS in which there is concept of linearity b/w the 
components is called linear data structure. The 
components exists in a certain sequence one after 
another. They have some successor or predecessor 
Example, Arrays, Stack, Queues etc.
Types of Linear Data Structures 
• Physical Linear Data Structures 
– The linear data structures whose successive 
components occupy consecutive memory 
locations are called physical linear DS. 
– Example, Array 
• Logical Linear Data Structures 
– The linear DS whose components are accessed 
in certain sequence but they are not necessarily 
stored in consecutive memory locations. 
– Example, Linked Lists 
Queues and Stacks are both logical and physical linear data 
structures
Non-Linear 
• The data structure in which the order of data structure 
does not matter and is not fixed 
– Example Tree, Graph 
• Record 
The collection of fields is called record. 
What is Domain? 
– Set of possible values of an item is called its domain 
– For example, set of possible values of Boolean type 
is 2
Arrays 
• A collection of consecutive locations having 
same type that can be accessed randomly. 
They are physical linear data structure 
• Types of Arrays 
– One Dimensional Array 
– Two Dimensional Array 
– Multidimensional Array
One Dimensional Arrays 
• 1-dimensional Arrays are also called vectors 
– Example, Int A[20]; 
– The elements of 1-d array are stored in consecutive 
memory locations 
– The start of array is called its base address 
– Let BA denotes the base address of the array and 
S denotes the size for each location, then the address 
of ith location can be accessed as: 
A(i)= BA + (i-1)* S 
Generally 
A(i)= BA + (i-lb)* S
2-d Array 
• Two dimensional array are used to store matrices 
• There are two methods for storing 2-d Arrays 
Row Major Order 
Column Major Order 
For Example int A[3][2]; 
Row Major Order 
1 2 3 4 5 6 
Column Major Order 
1 3 5 2 4 6
Row-Major and Column-Major Order 
• Consider 2-d array 
– int A[M][N]; 
– To reach an element in ith row and jth column will 
have to pass (i-1) rows and (j-1) columns. So address 
formula will be as: 
A(i,j)= BA+ [(i-1)*N + (j-1)]*S 
• In column Major Order 
A(i,j)= BA+ [(j-1)*M + (i-1)]*S 
– If lower and upper bounds are given then 
A(i,j)= BA+ [(i-L1)*(u2-L2+1) + (j-L2)]*S 
A(i,j)= BA+ [(j-L2)*(u1-L1+1) + (i-L1)]*S
3-d arrays 
• The storage for 3-d array has two types 
– Row- major order 
– Column – major order 
• In Row-Major order, first subscript varies more slowly 
than second which varies more slowly than 3rd element 
• In Column-Major order, 3rd subscript varies more 
slowly than 2nd which does more slowly than first one. 
– Example Int A[L][M][N] 
• Row-major order 
A(I,j,k)= BA+ [(i-1)*M*N +(j-1)*N+(k-1)]*S 
• Column-major order 
A(I,j,k)= BA+ [(k-1)L*M+(j-1)*M+(i]-1)]*S
N-Dimensional Array 
• Consider n-dimensional array variable as 
A[U1][U2]…….[Un] 
• Row-major order 
A(S1,S2,……Sn)= BA+ [(S1-1)U2*U3….Un+(S2-1)U3*U4….Un+(Sn- 
1 -1)Un+(Sn-1)]*S 
• Column-major order 
???

More Related Content

PPTX
Joins And Its Types
PPTX
Tree and graph
PDF
FP304 DATABASE SYSTEM PAPER FINAL EXAM AGAIN
PDF
Binary Search - Design & Analysis of Algorithms
PDF
Unit 1: Introduction to DBMS Unit 1 Complete
PDF
COMPILER DESIGN- Syntax Directed Translation
PDF
PPTX
Priority Queue in Data Structure
Joins And Its Types
Tree and graph
FP304 DATABASE SYSTEM PAPER FINAL EXAM AGAIN
Binary Search - Design & Analysis of Algorithms
Unit 1: Introduction to DBMS Unit 1 Complete
COMPILER DESIGN- Syntax Directed Translation
Priority Queue in Data Structure

What's hot (20)

PPTX
Data Structures (CS8391)
PDF
UNIT III NON LINEAR DATA STRUCTURES – TREES
PPTX
Relational algebra ppt
PDF
Goal based agent
PPT
Data structure lecture 1
PPTX
Binary Tree Traversal
PPT
Graphs
PDF
PPTX
PPTX
Integrity Constraints
PDF
Algorithms Lecture 7: Graph Algorithms
PPT
Spanning trees
PDF
Unit 1 DBMS
PPTX
PPTX
Transaction states and properties
PPTX
Data structure - Graph
PPT
Abstract data types
PPT
Er & eer to relational mapping
DOC
Time and space complexity
Data Structures (CS8391)
UNIT III NON LINEAR DATA STRUCTURES – TREES
Relational algebra ppt
Goal based agent
Data structure lecture 1
Binary Tree Traversal
Graphs
Integrity Constraints
Algorithms Lecture 7: Graph Algorithms
Spanning trees
Unit 1 DBMS
Transaction states and properties
Data structure - Graph
Abstract data types
Er & eer to relational mapping
Time and space complexity
Ad

Viewers also liked (13)

PPTX
Data Representation
PPTX
Introduction To Stack
PPTX
Computer Evolution
PPT
Improving Pronunciation
PPTX
Introduction to Algorithm
PPTX
Programming Language
PPTX
Processor Basics
PPTX
TYPES DATA STRUCTURES( LINEAR AND NON LINEAR)....
PPTX
Register & Memory
PPT
Assembly Language Lecture 1
PPTX
Data structure and its types
PPTX
Data Representation
PPT
Assembly Language Basics
Data Representation
Introduction To Stack
Computer Evolution
Improving Pronunciation
Introduction to Algorithm
Programming Language
Processor Basics
TYPES DATA STRUCTURES( LINEAR AND NON LINEAR)....
Register & Memory
Assembly Language Lecture 1
Data structure and its types
Data Representation
Assembly Language Basics
Ad

Similar to Introduction To Data Structures. (20)

PDF
BCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHI
PPTX
DSA Unit II array.pptx
PPT
Unit 1.ppt
PPTX
Data Structures - Array presentation .pptx
DOCX
Datastructures and algorithms prepared by M.V.Brehmanada Reddy
PPTX
Data structures - unit 1
PPTX
DSA Ch1(Introduction) [Recovered].pptx
PPTX
data structure unit -1_170434dd7400.pptx
PPTX
Dsa unit 1
PPT
Data structure and algorithms unit 1 pdf SRM
PDF
INTRODUCTION TO DATA STRUCTURES AND ALGORITHMS
PDF
INTRODUCTION TO DATA STRUCTURES AND ALGORITHM
PPTX
Data Structure Introduction- Arrays, Matrix, Linked List
PDF
M v bramhananda reddy dsa complete notes
PPTX
Data struchers and algorithms
PPTX
DataStructurePpt.pptx
PPT
C++ Data Structure PPT.ppt
PDF
cluod.pdf
PPTX
ntroduction of Algorithms, Analysing Algorithms. Arrays: Sparse Matrices - Re...
PPTX
DataStructureccvdgddfffdesddsssdssPpt.pptx
BCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHI
DSA Unit II array.pptx
Unit 1.ppt
Data Structures - Array presentation .pptx
Datastructures and algorithms prepared by M.V.Brehmanada Reddy
Data structures - unit 1
DSA Ch1(Introduction) [Recovered].pptx
data structure unit -1_170434dd7400.pptx
Dsa unit 1
Data structure and algorithms unit 1 pdf SRM
INTRODUCTION TO DATA STRUCTURES AND ALGORITHMS
INTRODUCTION TO DATA STRUCTURES AND ALGORITHM
Data Structure Introduction- Arrays, Matrix, Linked List
M v bramhananda reddy dsa complete notes
Data struchers and algorithms
DataStructurePpt.pptx
C++ Data Structure PPT.ppt
cluod.pdf
ntroduction of Algorithms, Analysing Algorithms. Arrays: Sparse Matrices - Re...
DataStructureccvdgddfffdesddsssdssPpt.pptx

More from Education Front (18)

PPTX
Generic Software Process Models
PPTX
2- Dimensional Arrays
PPTX
Problem Sloving
PPTX
Problem Solving - 1
PPTX
Process Models
PPTX
Process Models
PPT
Revised Process of Communication
PPT
Importance of Language in Communication
PPT
Lecture1 (SE Introduction)
PPTX
Lecture 2 (Software Processes)
PPTX
Introduction to data structure
PPTX
Facing Today’s Communication Challenges
PPTX
Introduction To EMU
PPTX
Lecture 2: Facing Today’s Communication Challenges.
PPTX
Effective communication skills
PPTX
Introduction to Presentation Skills
PPTX
Multiple Drug Resistance and Antibiotic Misuse in Urdu.
PPTX
Multiple Drug Resistance and Antibiotic Misuse In English.
Generic Software Process Models
2- Dimensional Arrays
Problem Sloving
Problem Solving - 1
Process Models
Process Models
Revised Process of Communication
Importance of Language in Communication
Lecture1 (SE Introduction)
Lecture 2 (Software Processes)
Introduction to data structure
Facing Today’s Communication Challenges
Introduction To EMU
Lecture 2: Facing Today’s Communication Challenges.
Effective communication skills
Introduction to Presentation Skills
Multiple Drug Resistance and Antibiotic Misuse in Urdu.
Multiple Drug Resistance and Antibiotic Misuse In English.

Recently uploaded (20)

PPTX
Lecture Notes Electrical Wiring System Components
PPTX
Strings in CPP - Strings in C++ are sequences of characters used to store and...
PDF
composite construction of structures.pdf
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PPTX
Lesson 3_Tessellation.pptx finite Mathematics
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPT
Drone Technology Electronics components_1
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PPTX
OOP with Java - Java Introduction (Basics)
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPTX
Construction Project Organization Group 2.pptx
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PDF
Digital Logic Computer Design lecture notes
PPTX
Geodesy 1.pptx...............................................
PPTX
bas. eng. economics group 4 presentation 1.pptx
PDF
Arduino robotics embedded978-1-4302-3184-4.pdf
Lecture Notes Electrical Wiring System Components
Strings in CPP - Strings in C++ are sequences of characters used to store and...
composite construction of structures.pdf
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
Lesson 3_Tessellation.pptx finite Mathematics
Foundation to blockchain - A guide to Blockchain Tech
Drone Technology Electronics components_1
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
Operating System & Kernel Study Guide-1 - converted.pdf
OOP with Java - Java Introduction (Basics)
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
Construction Project Organization Group 2.pptx
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Digital Logic Computer Design lecture notes
Geodesy 1.pptx...............................................
bas. eng. economics group 4 presentation 1.pptx
Arduino robotics embedded978-1-4302-3184-4.pdf

Introduction To Data Structures.

  • 1. Definitions What is Data Structure? “It is set of procedures to define, store, access and manipulate data” or “The organized collection of data is called data structure” or “The logical or mathematical model of a particular organization of data is called data structure”
  • 2. Types of Data Structure • Physical Data Structures – The data structures that have actually or physically same space in memory are called physical data structures – For example, one dimensional array • Logical Data Structures – The data structures which are treated, defined and stored in their logical picture – For example, Boolean data type
  • 3. Types of Data • Primitive • Non-primitive • Records and Files • Primitive(Elementary Data Types) – The data types which are processed or manipulated as a single whole(i.e, alone) – Example, integer, real, charater etc. – They are also called built-in data types
  • 4. Types of Data • Non-Primitive(Structure Data Types) – The items which are collection of other data structures are called non-primitive items. – If more than one values are combined in the single name is called non-primitive data structures – Example, Arrays, Stack, Queues etc. • Types of non-Primitive Data Structures – Linear – Non-Linear
  • 5. Linear Data Structures The DS in which there is concept of linearity b/w the components is called linear data structure. The components exists in a certain sequence one after another. They have some successor or predecessor Example, Arrays, Stack, Queues etc.
  • 6. Types of Linear Data Structures • Physical Linear Data Structures – The linear data structures whose successive components occupy consecutive memory locations are called physical linear DS. – Example, Array • Logical Linear Data Structures – The linear DS whose components are accessed in certain sequence but they are not necessarily stored in consecutive memory locations. – Example, Linked Lists Queues and Stacks are both logical and physical linear data structures
  • 7. Non-Linear • The data structure in which the order of data structure does not matter and is not fixed – Example Tree, Graph • Record The collection of fields is called record. What is Domain? – Set of possible values of an item is called its domain – For example, set of possible values of Boolean type is 2
  • 8. Arrays • A collection of consecutive locations having same type that can be accessed randomly. They are physical linear data structure • Types of Arrays – One Dimensional Array – Two Dimensional Array – Multidimensional Array
  • 9. One Dimensional Arrays • 1-dimensional Arrays are also called vectors – Example, Int A[20]; – The elements of 1-d array are stored in consecutive memory locations – The start of array is called its base address – Let BA denotes the base address of the array and S denotes the size for each location, then the address of ith location can be accessed as: A(i)= BA + (i-1)* S Generally A(i)= BA + (i-lb)* S
  • 10. 2-d Array • Two dimensional array are used to store matrices • There are two methods for storing 2-d Arrays Row Major Order Column Major Order For Example int A[3][2]; Row Major Order 1 2 3 4 5 6 Column Major Order 1 3 5 2 4 6
  • 11. Row-Major and Column-Major Order • Consider 2-d array – int A[M][N]; – To reach an element in ith row and jth column will have to pass (i-1) rows and (j-1) columns. So address formula will be as: A(i,j)= BA+ [(i-1)*N + (j-1)]*S • In column Major Order A(i,j)= BA+ [(j-1)*M + (i-1)]*S – If lower and upper bounds are given then A(i,j)= BA+ [(i-L1)*(u2-L2+1) + (j-L2)]*S A(i,j)= BA+ [(j-L2)*(u1-L1+1) + (i-L1)]*S
  • 12. 3-d arrays • The storage for 3-d array has two types – Row- major order – Column – major order • In Row-Major order, first subscript varies more slowly than second which varies more slowly than 3rd element • In Column-Major order, 3rd subscript varies more slowly than 2nd which does more slowly than first one. – Example Int A[L][M][N] • Row-major order A(I,j,k)= BA+ [(i-1)*M*N +(j-1)*N+(k-1)]*S • Column-major order A(I,j,k)= BA+ [(k-1)L*M+(j-1)*M+(i]-1)]*S
  • 13. N-Dimensional Array • Consider n-dimensional array variable as A[U1][U2]…….[Un] • Row-major order A(S1,S2,……Sn)= BA+ [(S1-1)U2*U3….Un+(S2-1)U3*U4….Un+(Sn- 1 -1)Un+(Sn-1)]*S • Column-major order ???