SlideShare a Scribd company logo
1
Basics of
Data
Structure
DS 2
PROGRAMMING
METHODOLOGY
DS 3
 Data Structure is structural representation of logical relationship between
elements of Data.
 DS is used for utilizing the maximum efficiency of Memory
 Organized Data + Operation = Data Structure
 Algorithm + Data Structure = Program.
 ALGORITHM : It’s a step by step finite sequence of instruction to solve a well
defined computational problem.
 Optimization of program is directly concerned with the algorithm design.
 Representation of DS in memory of a computer is called storage structure.
 A Storage structure stored in auxiliary memory is known as File Structure.
TERMINOLOGY
DS 4
Informal
Algorithm
Mathematical
Model
Psedo–
Language
Program
Formal
Language
C / C++
Program
Data
Structure
STEP WISE REFINEMENT
DS 5
 Modular Programming is an act of writing programs as functions, that each
one perform a single well defined task, and which have minimum interaction
between them.
 High cohesion : Related with specific task only.
 Low Coupling : Independent from each other.
 Two Methods:
(i). TOP – DOWN Methodology (eg. C, C++ Programming)
(ii). BOTTOM – UP Methodology (eg. VB Project implementation)
MODULAR PROGRAMMING
DS 6
Main
Function 1 Function 2 Function 3
Function a Function b Function c Function c Function b Function d
Functions called By Function 1 Functions called By Function 3
Functions called
By Function 1
PROGRAMMING APPROCH
DS 7
 Sequence of sequentially executed statements
 Conditional Execution (if)
 Looping or iteration (for, while, do-while)
 Structured Subroutine (Function)
STRUCTURED PROGRAMMING
DS 8
ARRAYS
 An array is a collection of homogeneous
data elements described by a single name.
 Insertion and Deletion can not be made.
i. 1-D Array
ii. 2-D Array
iii. M-D Array
iv. Sparse Arrays
VECTOR
 1-D ordered collection of number
i. Row Vector
ii. Column Vector
LISTS
 A list is an ordered set consisting of a varying
number of elements to which insertion and
deletion can be made
12
52
35
10 11
12
13
14
15
START
11 12 13 14 15
SOME D.S.
DS 9
FILES & RECORDS
 File is typically large list that is stored in the
external memory of computer.
 A record is collection of information about some
particular entity.
 Record may be collection of heterogeneous data.
 File is collection of such a records.
CHARECTERISTICS
OF STRING
 Fixed length string
 Variable length string
 Linear list (Linked List)
DS 10
Data
Structure
Primitive
Data Structure
Non-Primitive
Data Structure
int char float pointer
Linear
list
Graph Tree
list
Array File
Non - Linear
list
Stack Queue
CLASSIFICATION OF D.S.
DS 11
 malloc ()
 Allocates 1 block of memory
ptr=(Data_Type *)malloc(n * sizeof(Data_Type));
 callloc ()
 Allocates n block of memory
ptr=(Data_Type *)calloc(n , sizeof(Data_Type));
 realloc ()
 Resize the original block of memory
ptr=realloc(ptr, NewSize);
 free ()
 Free up the memory block
free (ptr);
 Dynamic or Run Time memory
allocation (Linked list)
 Static or Compile Time
memory allocation (Array)
int a, array[10];
char str[80];
Dynamic memory
allocation in C++
int *var1 = new int;
float *var2 = new float;
delete var1;
delete var2;
MEMORY MANAGEMENT
DS 12
 Free Storage List
 Garbage Collection
 Dangling Reference
 Reference Counter
MEMORY MANAGEMENT
DS 13

More Related Content

Similar to 00. Basics of Data Structures.ppt

unit 1.pptx
unit 1.pptxunit 1.pptx
unit 1.pptx
NIVETHA37590
 
Lecture 1.pptx
Lecture 1.pptxLecture 1.pptx
Lecture 1.pptx
WaelGomaa15
 
Database management system
Database management systemDatabase management system
Database management system
khagendrabasnet4
 
PP DBMS - 1 (1).pptx
PP DBMS - 1 (1).pptxPP DBMS - 1 (1).pptx
PP DBMS - 1 (1).pptx
skilljiolms
 
PP DBMS - 1 (2).pptx
PP DBMS - 1 (2).pptxPP DBMS - 1 (2).pptx
PP DBMS - 1 (2).pptx
skilljiolms
 
PP DBMS - 1 (1).pptx
PP DBMS - 1 (1).pptxPP DBMS - 1 (1).pptx
PP DBMS - 1 (1).pptx
skilljiolms
 
DataStructurePpt.pptx
DataStructurePpt.pptxDataStructurePpt.pptx
DataStructurePpt.pptx
DCABCA
 
Data structure
Data structureData structure
Data structure
Prof. Dr. K. Adisesha
 
Kskv kutch university DBMS unit 1 basic concepts, data,information,database,...
Kskv kutch university DBMS unit 1  basic concepts, data,information,database,...Kskv kutch university DBMS unit 1  basic concepts, data,information,database,...
Kskv kutch university DBMS unit 1 basic concepts, data,information,database,...
Dipen Parmar
 
data structures module I & II.pptx
data structures module I & II.pptxdata structures module I & II.pptx
data structures module I & II.pptx
rani marri
 
СРС АКТ Малошов Нұралы ВМ-МҚБ-11-23.pptx
СРС АКТ Малошов Нұралы ВМ-МҚБ-11-23.pptxСРС АКТ Малошов Нұралы ВМ-МҚБ-11-23.pptx
СРС АКТ Малошов Нұралы ВМ-МҚБ-11-23.pptx
ssuser8719a6
 
unit 1.pptx
unit 1.pptxunit 1.pptx
unit 1.pptx
GayathriPG3
 
Data structure introduction
Data structure introductionData structure introduction
Data structure introduction
ramyasanthosh
 
Introduction to Data structure and algorithm.pptx
Introduction to Data structure and algorithm.pptxIntroduction to Data structure and algorithm.pptx
Introduction to Data structure and algorithm.pptx
line24arts
 
UNIT II.docx
UNIT II.docxUNIT II.docx
UNIT II.docx
Revathiparamanathan
 
1- Introduction.pptx.pdf
1- Introduction.pptx.pdf1- Introduction.pptx.pdf
1- Introduction.pptx.pdf
gm6523
 
DataStructurePpt.pptx
DataStructurePpt.pptxDataStructurePpt.pptx
DataStructurePpt.pptx
ssuser031f35
 

Similar to 00. Basics of Data Structures.ppt (20)

unit 1.pptx
unit 1.pptxunit 1.pptx
unit 1.pptx
 
Lecture 1.pptx
Lecture 1.pptxLecture 1.pptx
Lecture 1.pptx
 
7 data management design
7 data management design7 data management design
7 data management design
 
Database management system
Database management systemDatabase management system
Database management system
 
PP DBMS - 1 (1).pptx
PP DBMS - 1 (1).pptxPP DBMS - 1 (1).pptx
PP DBMS - 1 (1).pptx
 
PP DBMS - 1 (2).pptx
PP DBMS - 1 (2).pptxPP DBMS - 1 (2).pptx
PP DBMS - 1 (2).pptx
 
PP DBMS - 1 (1).pptx
PP DBMS - 1 (1).pptxPP DBMS - 1 (1).pptx
PP DBMS - 1 (1).pptx
 
DataStructurePpt.pptx
DataStructurePpt.pptxDataStructurePpt.pptx
DataStructurePpt.pptx
 
Data structure
Data structureData structure
Data structure
 
Kskv kutch university DBMS unit 1 basic concepts, data,information,database,...
Kskv kutch university DBMS unit 1  basic concepts, data,information,database,...Kskv kutch university DBMS unit 1  basic concepts, data,information,database,...
Kskv kutch university DBMS unit 1 basic concepts, data,information,database,...
 
data structures module I & II.pptx
data structures module I & II.pptxdata structures module I & II.pptx
data structures module I & II.pptx
 
СРС АКТ Малошов Нұралы ВМ-МҚБ-11-23.pptx
СРС АКТ Малошов Нұралы ВМ-МҚБ-11-23.pptxСРС АКТ Малошов Нұралы ВМ-МҚБ-11-23.pptx
СРС АКТ Малошов Нұралы ВМ-МҚБ-11-23.pptx
 
unit 1.pptx
unit 1.pptxunit 1.pptx
unit 1.pptx
 
Data structure introduction
Data structure introductionData structure introduction
Data structure introduction
 
Ds intro
Ds introDs intro
Ds intro
 
Introduction to Data structure and algorithm.pptx
Introduction to Data structure and algorithm.pptxIntroduction to Data structure and algorithm.pptx
Introduction to Data structure and algorithm.pptx
 
UNIT II.docx
UNIT II.docxUNIT II.docx
UNIT II.docx
 
1- Introduction.pptx.pdf
1- Introduction.pptx.pdf1- Introduction.pptx.pdf
1- Introduction.pptx.pdf
 
DataStructurePpt.pptx
DataStructurePpt.pptxDataStructurePpt.pptx
DataStructurePpt.pptx
 
27 fcs157al2
27 fcs157al227 fcs157al2
27 fcs157al2
 

Recently uploaded

Landownership in the Philippines under the Americans-2-pptx.pptx
Landownership in the Philippines under the Americans-2-pptx.pptxLandownership in the Philippines under the Americans-2-pptx.pptx
Landownership in the Philippines under the Americans-2-pptx.pptx
JezreelCabil2
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
Celine George
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
Krisztián Száraz
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Ashish Kohli
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
RitikBhardwaj56
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
ak6969907
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
goswamiyash170123
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 

Recently uploaded (20)

Landownership in the Philippines under the Americans-2-pptx.pptx
Landownership in the Philippines under the Americans-2-pptx.pptxLandownership in the Philippines under the Americans-2-pptx.pptx
Landownership in the Philippines under the Americans-2-pptx.pptx
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 

00. Basics of Data Structures.ppt

  • 3. DS 3  Data Structure is structural representation of logical relationship between elements of Data.  DS is used for utilizing the maximum efficiency of Memory  Organized Data + Operation = Data Structure  Algorithm + Data Structure = Program.  ALGORITHM : It’s a step by step finite sequence of instruction to solve a well defined computational problem.  Optimization of program is directly concerned with the algorithm design.  Representation of DS in memory of a computer is called storage structure.  A Storage structure stored in auxiliary memory is known as File Structure. TERMINOLOGY
  • 5. DS 5  Modular Programming is an act of writing programs as functions, that each one perform a single well defined task, and which have minimum interaction between them.  High cohesion : Related with specific task only.  Low Coupling : Independent from each other.  Two Methods: (i). TOP – DOWN Methodology (eg. C, C++ Programming) (ii). BOTTOM – UP Methodology (eg. VB Project implementation) MODULAR PROGRAMMING
  • 6. DS 6 Main Function 1 Function 2 Function 3 Function a Function b Function c Function c Function b Function d Functions called By Function 1 Functions called By Function 3 Functions called By Function 1 PROGRAMMING APPROCH
  • 7. DS 7  Sequence of sequentially executed statements  Conditional Execution (if)  Looping or iteration (for, while, do-while)  Structured Subroutine (Function) STRUCTURED PROGRAMMING
  • 8. DS 8 ARRAYS  An array is a collection of homogeneous data elements described by a single name.  Insertion and Deletion can not be made. i. 1-D Array ii. 2-D Array iii. M-D Array iv. Sparse Arrays VECTOR  1-D ordered collection of number i. Row Vector ii. Column Vector LISTS  A list is an ordered set consisting of a varying number of elements to which insertion and deletion can be made 12 52 35 10 11 12 13 14 15 START 11 12 13 14 15 SOME D.S.
  • 9. DS 9 FILES & RECORDS  File is typically large list that is stored in the external memory of computer.  A record is collection of information about some particular entity.  Record may be collection of heterogeneous data.  File is collection of such a records. CHARECTERISTICS OF STRING  Fixed length string  Variable length string  Linear list (Linked List)
  • 10. DS 10 Data Structure Primitive Data Structure Non-Primitive Data Structure int char float pointer Linear list Graph Tree list Array File Non - Linear list Stack Queue CLASSIFICATION OF D.S.
  • 11. DS 11  malloc ()  Allocates 1 block of memory ptr=(Data_Type *)malloc(n * sizeof(Data_Type));  callloc ()  Allocates n block of memory ptr=(Data_Type *)calloc(n , sizeof(Data_Type));  realloc ()  Resize the original block of memory ptr=realloc(ptr, NewSize);  free ()  Free up the memory block free (ptr);  Dynamic or Run Time memory allocation (Linked list)  Static or Compile Time memory allocation (Array) int a, array[10]; char str[80]; Dynamic memory allocation in C++ int *var1 = new int; float *var2 = new float; delete var1; delete var2; MEMORY MANAGEMENT
  • 12. DS 12  Free Storage List  Garbage Collection  Dangling Reference  Reference Counter MEMORY MANAGEMENT
  • 13. DS 13