SlideShare a Scribd company logo
Data Structures: A Pseudocode Approach with C, Second Edition1
Chapter 1Chapter 1
Objectives
• Use pseudocode in the development of algorithms
• Understand the need for Abstract Data Type (ADT)
• Understand the implementation of ADTs
• Use void pointers and pointer to functions
• Understand the role of Big-O notation
Basic ConceptsBasic Concepts
Data Structures: A Pseudocode Approach with C, Second Edition2
Pseudocode
Pseudocode is an English-like representation of the algorithm logic. ItPseudocode is an English-like representation of the algorithm logic. It
consists of an extended version of the basic algorithmic constructs:consists of an extended version of the basic algorithmic constructs:
sequence, selection, and iterationsequence, selection, and iteration..
•Algorithm Header
•Purpose, Condition, and Return
•Statement Numbers
•Variables
•Statment Constructs
•Algorithm Analysis
Data Structures: A Pseudocode Approach with C, Second Edition3
Data Structures: A Pseudocode Approach with C, Second Edition4
Data Structures: A Pseudocode Approach with C, Second Edition5
The Abstract Data Type
An ADT consists of a data declaration packagedAn ADT consists of a data declaration packaged
together with the operations that are meaningfultogether with the operations that are meaningful
on the data while embodying the structuredon the data while embodying the structured
principles of encapsulation and data hiding. In this sectionprinciples of encapsulation and data hiding. In this section
we define the basic parts of an ADT.we define the basic parts of an ADT.
•Atomic and Composite Data
•Data Type
•Data Structure
•Abstract Data Type
Data Structures: A Pseudocode Approach with C, Second Edition6
Data Structures: A Pseudocode Approach with C, Second Edition7
Data Structure
Aggregation of atomic and composite data into a set with defined
relationships. Structure refers to a set of rules that hold the data
together.
• A combination of elements in which each is either a data type or another
data structure.
• A set of associations of relationship involving combined elements.
Example:
Data Structures: A Pseudocode Approach with C, Second Edition8
Data Structures: A Pseudocode Approach with C, Second Edition9
Abstract Data Type
 ADT users are NOT concerned with how the task is done but rather what it
can do.
 An abstract data type is a data declaration packaged together with the
operations that are meaningful for the data type.
 We encapsulate the data and the operations on the data, and then hide
them from the user.
 All references to and manipulation of the data in a data structure are handled
through defined interfaces to the structure.
Data Structures: A Pseudocode Approach with C, Second Edition10
Model for an Abstract Data Type
In this section we provide a conceptual
model for an Abstract Data Type (ADT).
• ADT Operation – passage like
• ADT Data Structure – controlled
entirely
Data Structures: A Pseudocode Approach with C, Second Edition11
Data Structures: A Pseudocode Approach with C, Second Edition12
ADT Implementations
There are two basic structures we can use to
implement an ADT list: arrays and linked lists.
In this section we discuss the basic
linked-list implementation.
• Array Implementation
• Linked List Implemenation
Data Structures: A Pseudocode Approach with C, Second Edition13
Data Structures: A Pseudocode Approach with C, Second Edition14
Data Structures: A Pseudocode Approach with C, Second Edition15
Data Structures: A Pseudocode Approach with C, Second Edition16
Generic Code for ADT
In this section we discuss and provide examples
of two C tools that are required to implement
an ADT.
• Pointer to Void
• Pointer to Function
Data Structures: A Pseudocode Approach with C, Second Edition17
Data Structures: A Pseudocode Approach with C, Second Edition18
Data Structures: A Pseudocode Approach with C, Second Edition19
Data Structures: A Pseudocode Approach with C, Second Edition20
Data Structures: A Pseudocode Approach with C, Second Edition21
(Continued)
Data Structures: A Pseudocode Approach with C, Second Edition22
Data Structures: A Pseudocode Approach with C, Second Edition23
Data Structures: A Pseudocode Approach with C, Second Edition24
Data Structures: A Pseudocode Approach with C, Second Edition25
Data Structures: A Pseudocode Approach with C, Second Edition26
(Continued)
Data Structures: A Pseudocode Approach with C, Second Edition27
Data Structures: A Pseudocode Approach with C, Second Edition28
Data Structures: A Pseudocode Approach with C, Second Edition29
Data Structures: A Pseudocode Approach with C, Second Edition30
Data Structures: A Pseudocode Approach with C, Second Edition31
Data Structures: A Pseudocode Approach with C, Second Edition32
Data Structures: A Pseudocode Approach with C, Second Edition33
Data Structures: A Pseudocode Approach with C, Second Edition34
Data Structures: A Pseudocode Approach with C, Second Edition35
Algorithm Efficiency
To design and implement algorithms, programmersTo design and implement algorithms, programmers
must have a basic understanding of what constitutesmust have a basic understanding of what constitutes
good, efficient algorithms.good, efficient algorithms.
Linear Loops
-Efficiency is a function of the number of intstructions.
- Loop update either adds or subtracts.
• Logarithmic Loops
-The controlling variable is either multiplied or divided in each iteration.
- The number of iteration is a function of the multiplier or divisor.
• Nested Loops
- The number of iterations is the total number which is the product of the number of
iterations in the inner loop and number of iterations in the outer loop.
• Big-O Notation
-Not concerned with exact measurement of efficiency but with the magnitude.
- A dominant factor determines the magnitute.

More Related Content

What's hot

Knowledge Engineering in FOL.
Knowledge Engineering in FOL.Knowledge Engineering in FOL.
Knowledge Engineering in FOL.
Megha Sharma
 
Graph representation
Graph representationGraph representation
Graph representationTech_MX
 
Mathematics Foundation Course for Machine Learning & AI By Eduonix
Mathematics Foundation Course for Machine Learning & AI By Eduonix Mathematics Foundation Course for Machine Learning & AI By Eduonix
Mathematics Foundation Course for Machine Learning & AI By Eduonix
Nick Trott
 
Graph theory introduction - Samy
Graph theory  introduction - SamyGraph theory  introduction - Samy
Graph theory introduction - Samy
Mark Arokiasamy
 
Clustering - Machine Learning Techniques
Clustering - Machine Learning TechniquesClustering - Machine Learning Techniques
Clustering - Machine Learning Techniques
Kush Kulshrestha
 
CH11-Digital Logic.pptx
CH11-Digital Logic.pptxCH11-Digital Logic.pptx
CH11-Digital Logic.pptx
FathoniMahardika1
 
introduction to graph theory
introduction to graph theoryintroduction to graph theory
introduction to graph theoryChuckie Balbuena
 
Group Theory
Group TheoryGroup Theory
Group Theory
Durgesh Chahar
 
IMPROPER INTEGRALS AND APPLICATION OF INTEGRATION
IMPROPER  INTEGRALS AND  APPLICATION  OF INTEGRATIONIMPROPER  INTEGRALS AND  APPLICATION  OF INTEGRATION
IMPROPER INTEGRALS AND APPLICATION OF INTEGRATION
Drazzer_Dhruv
 
Rules of integration
Rules of integrationRules of integration
Rules of integration
klawdet
 
Max Entropy
Max EntropyMax Entropy
Max Entropyjianingy
 
Role of Bellman's Equation in Reinforcement Learning
Role of Bellman's Equation in Reinforcement LearningRole of Bellman's Equation in Reinforcement Learning
Role of Bellman's Equation in Reinforcement Learning
VARUN KUMAR
 
Knowledge representation in AI
Knowledge representation in AIKnowledge representation in AI
Knowledge representation in AIVishal Singh
 
Design and Analysis of Algorithm ppt for unit one
Design and Analysis of Algorithm ppt for unit oneDesign and Analysis of Algorithm ppt for unit one
Design and Analysis of Algorithm ppt for unit one
ssuserb7c8b8
 
Genetic algorithms
Genetic algorithmsGenetic algorithms
Genetic algorithms
Mehmet Ozgur Unal
 
Ordinary differential equation
Ordinary differential equationOrdinary differential equation
Ordinary differential equation
JUGAL BORAH
 
UNIT II LINEAR DATA STRUCTURES – STACKS, QUEUES
UNIT II 	LINEAR DATA STRUCTURES – STACKS, QUEUES	UNIT II 	LINEAR DATA STRUCTURES – STACKS, QUEUES
UNIT II LINEAR DATA STRUCTURES – STACKS, QUEUES
Kathirvel Ayyaswamy
 
Instance based learning
Instance based learningInstance based learning
Instance based learningSlideshare
 
Cellular Automata
Cellular AutomataCellular Automata
Cellular Automata
Kirthi Balakrishnan
 
First order logic
First order logicFirst order logic
First order logic
Megha Sharma
 

What's hot (20)

Knowledge Engineering in FOL.
Knowledge Engineering in FOL.Knowledge Engineering in FOL.
Knowledge Engineering in FOL.
 
Graph representation
Graph representationGraph representation
Graph representation
 
Mathematics Foundation Course for Machine Learning & AI By Eduonix
Mathematics Foundation Course for Machine Learning & AI By Eduonix Mathematics Foundation Course for Machine Learning & AI By Eduonix
Mathematics Foundation Course for Machine Learning & AI By Eduonix
 
Graph theory introduction - Samy
Graph theory  introduction - SamyGraph theory  introduction - Samy
Graph theory introduction - Samy
 
Clustering - Machine Learning Techniques
Clustering - Machine Learning TechniquesClustering - Machine Learning Techniques
Clustering - Machine Learning Techniques
 
CH11-Digital Logic.pptx
CH11-Digital Logic.pptxCH11-Digital Logic.pptx
CH11-Digital Logic.pptx
 
introduction to graph theory
introduction to graph theoryintroduction to graph theory
introduction to graph theory
 
Group Theory
Group TheoryGroup Theory
Group Theory
 
IMPROPER INTEGRALS AND APPLICATION OF INTEGRATION
IMPROPER  INTEGRALS AND  APPLICATION  OF INTEGRATIONIMPROPER  INTEGRALS AND  APPLICATION  OF INTEGRATION
IMPROPER INTEGRALS AND APPLICATION OF INTEGRATION
 
Rules of integration
Rules of integrationRules of integration
Rules of integration
 
Max Entropy
Max EntropyMax Entropy
Max Entropy
 
Role of Bellman's Equation in Reinforcement Learning
Role of Bellman's Equation in Reinforcement LearningRole of Bellman's Equation in Reinforcement Learning
Role of Bellman's Equation in Reinforcement Learning
 
Knowledge representation in AI
Knowledge representation in AIKnowledge representation in AI
Knowledge representation in AI
 
Design and Analysis of Algorithm ppt for unit one
Design and Analysis of Algorithm ppt for unit oneDesign and Analysis of Algorithm ppt for unit one
Design and Analysis of Algorithm ppt for unit one
 
Genetic algorithms
Genetic algorithmsGenetic algorithms
Genetic algorithms
 
Ordinary differential equation
Ordinary differential equationOrdinary differential equation
Ordinary differential equation
 
UNIT II LINEAR DATA STRUCTURES – STACKS, QUEUES
UNIT II 	LINEAR DATA STRUCTURES – STACKS, QUEUES	UNIT II 	LINEAR DATA STRUCTURES – STACKS, QUEUES
UNIT II LINEAR DATA STRUCTURES – STACKS, QUEUES
 
Instance based learning
Instance based learningInstance based learning
Instance based learning
 
Cellular Automata
Cellular AutomataCellular Automata
Cellular Automata
 
First order logic
First order logicFirst order logic
First order logic
 

Viewers also liked

Cse
CseCse
Cse
vdrkk
 
Pseudocode
PseudocodePseudocode
Pseudocode
Guy09
 
Pseudocode
PseudocodePseudocode
Pseudocode
Harsha Madushanka
 
Pseudocode
PseudocodePseudocode
Pseudocode
grahamwell
 
Algoritma pemrogmraman
Algoritma pemrogmramanAlgoritma pemrogmraman
Algoritma pemrogmramannoval riansyah
 
Pseudocode basics
Pseudocode basicsPseudocode basics
Pseudocode basicskiran_kaur
 
Pseudocode algorithim flowchart
Pseudocode algorithim flowchartPseudocode algorithim flowchart
Pseudocode algorithim flowchart
fika sweety
 
Algoritma dan Struktur Data - Pseudocode
Algoritma dan Struktur Data - PseudocodeAlgoritma dan Struktur Data - Pseudocode
Algoritma dan Struktur Data - Pseudocode
Georgius Rinaldo
 
The pseudocode
The pseudocodeThe pseudocode
The pseudocode
Asha Sari
 
03 pseudocode
03 pseudocode03 pseudocode
03 pseudocode
Indra Abdam Muwakhid
 
Algoritma dan Pemrograman C++ (Pseudocode & Flowchart)
Algoritma dan Pemrograman C++ (Pseudocode & Flowchart)Algoritma dan Pemrograman C++ (Pseudocode & Flowchart)
Algoritma dan Pemrograman C++ (Pseudocode & Flowchart)Nabil Muhammad Firdaus
 
03 algoritma flowchart
03 algoritma flowchart03 algoritma flowchart
03 algoritma flowchart
Arif Rahman
 
A complete course in Program Design using Pseudocode
A complete course in Program Design using Pseudocode A complete course in Program Design using Pseudocode
A complete course in Program Design using Pseudocode
Damian T. Gordon
 
Pseudocode-Flowchart
Pseudocode-FlowchartPseudocode-Flowchart
Pseudocode-Flowchartlotlot
 
Algorithm and pseudo codes
Algorithm and pseudo codesAlgorithm and pseudo codes
Algorithm and pseudo codeshermiraguilar
 
Introduction to Pseudocode
Introduction to PseudocodeIntroduction to Pseudocode
Introduction to PseudocodeDamian T. Gordon
 
Flowchart pseudocode-examples
Flowchart pseudocode-examplesFlowchart pseudocode-examples
Flowchart pseudocode-examples
Gautam Roy
 
Pseudocode flowcharts
Pseudocode flowchartsPseudocode flowcharts
Pseudocode flowchartsnicky_walters
 

Viewers also liked (20)

Cse
CseCse
Cse
 
Pseudocode
PseudocodePseudocode
Pseudocode
 
Pseudocode
PseudocodePseudocode
Pseudocode
 
Pseudocode
PseudocodePseudocode
Pseudocode
 
Algoritma pemrogmraman
Algoritma pemrogmramanAlgoritma pemrogmraman
Algoritma pemrogmraman
 
Pseudocode basics
Pseudocode basicsPseudocode basics
Pseudocode basics
 
Pseudocode algorithim flowchart
Pseudocode algorithim flowchartPseudocode algorithim flowchart
Pseudocode algorithim flowchart
 
Algoritma dan Struktur Data - Pseudocode
Algoritma dan Struktur Data - PseudocodeAlgoritma dan Struktur Data - Pseudocode
Algoritma dan Struktur Data - Pseudocode
 
The pseudocode
The pseudocodeThe pseudocode
The pseudocode
 
03 pseudocode
03 pseudocode03 pseudocode
03 pseudocode
 
Tugas algoritma ( flowchart )
Tugas algoritma ( flowchart )Tugas algoritma ( flowchart )
Tugas algoritma ( flowchart )
 
Algoritma dan Pemrograman C++ (Pseudocode & Flowchart)
Algoritma dan Pemrograman C++ (Pseudocode & Flowchart)Algoritma dan Pemrograman C++ (Pseudocode & Flowchart)
Algoritma dan Pemrograman C++ (Pseudocode & Flowchart)
 
03 algoritma flowchart
03 algoritma flowchart03 algoritma flowchart
03 algoritma flowchart
 
A complete course in Program Design using Pseudocode
A complete course in Program Design using Pseudocode A complete course in Program Design using Pseudocode
A complete course in Program Design using Pseudocode
 
Pseudocode-Flowchart
Pseudocode-FlowchartPseudocode-Flowchart
Pseudocode-Flowchart
 
Algorithm and pseudo codes
Algorithm and pseudo codesAlgorithm and pseudo codes
Algorithm and pseudo codes
 
Writing algorithms
Writing algorithmsWriting algorithms
Writing algorithms
 
Introduction to Pseudocode
Introduction to PseudocodeIntroduction to Pseudocode
Introduction to Pseudocode
 
Flowchart pseudocode-examples
Flowchart pseudocode-examplesFlowchart pseudocode-examples
Flowchart pseudocode-examples
 
Pseudocode flowcharts
Pseudocode flowchartsPseudocode flowcharts
Pseudocode flowcharts
 

Similar to Basic concepts

Basic.ppt
Basic.pptBasic.ppt
Basic.ppt
VandanaBharti21
 
Ds new
Ds newDs new
Ds new
CS_GDRCST
 
Stack implementation using c
Stack implementation using cStack implementation using c
Stack implementation using c
Rajendran
 
Lecture6
Lecture6Lecture6
Lecture6
Vijay Soni
 
Stack implementations
Stack implementationsStack implementations
Stack implementations
Rajendran
 
Algorithm Specification and Data Abstraction
Algorithm Specification and Data Abstraction Algorithm Specification and Data Abstraction
Algorithm Specification and Data Abstraction
Ashutosh Satapathy
 
1. Fundamental Concept - Data Structures using C++ by Varsha Patil
1. Fundamental Concept - Data Structures using C++ by Varsha Patil1. Fundamental Concept - Data Structures using C++ by Varsha Patil
1. Fundamental Concept - Data Structures using C++ by Varsha Patil
widespreadpromotion
 
Csc1100 lecture01 ch01 pt2-paradigm (1)
Csc1100 lecture01 ch01 pt2-paradigm (1)Csc1100 lecture01 ch01 pt2-paradigm (1)
Csc1100 lecture01 ch01 pt2-paradigm (1)IIUM
 
Csc1100 lecture01 ch01 pt2-paradigm
Csc1100 lecture01 ch01 pt2-paradigmCsc1100 lecture01 ch01 pt2-paradigm
Csc1100 lecture01 ch01 pt2-paradigm
IIUM
 
C04701019027
C04701019027C04701019027
C04701019027
ijceronline
 
CS2006Ch02A.ppt dfxgbfdcgbhfcdhbfdcbfdcgfdg
CS2006Ch02A.ppt dfxgbfdcgbhfcdhbfdcbfdcgfdgCS2006Ch02A.ppt dfxgbfdcgbhfcdhbfdcbfdcgfdg
CS2006Ch02A.ppt dfxgbfdcgbhfcdhbfdcbfdcgfdg
RahithAhsan1
 
2. visualization in data mining
2. visualization in data mining2. visualization in data mining
2. visualization in data mining
Azad public school
 
Chap-02-01.ppt
Chap-02-01.pptChap-02-01.ppt
Chap-02-01.ppt
ssuser5ad1571
 
Chap-02-1.ppt
Chap-02-1.pptChap-02-1.ppt
Chap-02-1.ppt
Vamshi171
 
Chap-02-1.ppt
Chap-02-1.pptChap-02-1.ppt
Chap-02-1.ppt
ShraddhaPattnaik
 
Chap-02-1.ppt
Chap-02-1.pptChap-02-1.ppt
Chap-02-1.ppt
UdhayaKumar175069
 
Chap-02-1.ppt
Chap-02-1.pptChap-02-1.ppt
Chap-02-1.ppt
hamsa72
 
Chap-02-1.ppt
Chap-02-1.pptChap-02-1.ppt
Chap-02-1.ppt
ssusere6f5a11
 
Chap 02-1
Chap 02-1Chap 02-1
Chap 02-1
Navjot Singh
 

Similar to Basic concepts (20)

Basic.ppt
Basic.pptBasic.ppt
Basic.ppt
 
Ds new
Ds newDs new
Ds new
 
Stack implementation using c
Stack implementation using cStack implementation using c
Stack implementation using c
 
Lecture6
Lecture6Lecture6
Lecture6
 
Stack implementations
Stack implementationsStack implementations
Stack implementations
 
Algorithm Specification and Data Abstraction
Algorithm Specification and Data Abstraction Algorithm Specification and Data Abstraction
Algorithm Specification and Data Abstraction
 
1. Fundamental Concept - Data Structures using C++ by Varsha Patil
1. Fundamental Concept - Data Structures using C++ by Varsha Patil1. Fundamental Concept - Data Structures using C++ by Varsha Patil
1. Fundamental Concept - Data Structures using C++ by Varsha Patil
 
Csc1100 lecture01 ch01 pt2-paradigm (1)
Csc1100 lecture01 ch01 pt2-paradigm (1)Csc1100 lecture01 ch01 pt2-paradigm (1)
Csc1100 lecture01 ch01 pt2-paradigm (1)
 
Csc1100 lecture01 ch01 pt2-paradigm
Csc1100 lecture01 ch01 pt2-paradigmCsc1100 lecture01 ch01 pt2-paradigm
Csc1100 lecture01 ch01 pt2-paradigm
 
C04701019027
C04701019027C04701019027
C04701019027
 
CS2006Ch02A.ppt dfxgbfdcgbhfcdhbfdcbfdcgfdg
CS2006Ch02A.ppt dfxgbfdcgbhfcdhbfdcbfdcgfdgCS2006Ch02A.ppt dfxgbfdcgbhfcdhbfdcbfdcgfdg
CS2006Ch02A.ppt dfxgbfdcgbhfcdhbfdcbfdcgfdg
 
2. visualization in data mining
2. visualization in data mining2. visualization in data mining
2. visualization in data mining
 
Chap-02-01.ppt
Chap-02-01.pptChap-02-01.ppt
Chap-02-01.ppt
 
Chap-02-1.ppt
Chap-02-1.pptChap-02-1.ppt
Chap-02-1.ppt
 
Chap-02-1.ppt
Chap-02-1.pptChap-02-1.ppt
Chap-02-1.ppt
 
Chap-02-1.ppt
Chap-02-1.pptChap-02-1.ppt
Chap-02-1.ppt
 
Chap-02-1.ppt
Chap-02-1.pptChap-02-1.ppt
Chap-02-1.ppt
 
C programming-1.pptx
C programming-1.pptxC programming-1.pptx
C programming-1.pptx
 
Chap-02-1.ppt
Chap-02-1.pptChap-02-1.ppt
Chap-02-1.ppt
 
Chap 02-1
Chap 02-1Chap 02-1
Chap 02-1
 

Recently uploaded

CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
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
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
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
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 

Recently uploaded (20)

CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
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
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
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 Á...
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 

Basic concepts

  • 1. Data Structures: A Pseudocode Approach with C, Second Edition1 Chapter 1Chapter 1 Objectives • Use pseudocode in the development of algorithms • Understand the need for Abstract Data Type (ADT) • Understand the implementation of ADTs • Use void pointers and pointer to functions • Understand the role of Big-O notation Basic ConceptsBasic Concepts
  • 2. Data Structures: A Pseudocode Approach with C, Second Edition2 Pseudocode Pseudocode is an English-like representation of the algorithm logic. ItPseudocode is an English-like representation of the algorithm logic. It consists of an extended version of the basic algorithmic constructs:consists of an extended version of the basic algorithmic constructs: sequence, selection, and iterationsequence, selection, and iteration.. •Algorithm Header •Purpose, Condition, and Return •Statement Numbers •Variables •Statment Constructs •Algorithm Analysis
  • 3. Data Structures: A Pseudocode Approach with C, Second Edition3
  • 4. Data Structures: A Pseudocode Approach with C, Second Edition4
  • 5. Data Structures: A Pseudocode Approach with C, Second Edition5 The Abstract Data Type An ADT consists of a data declaration packagedAn ADT consists of a data declaration packaged together with the operations that are meaningfultogether with the operations that are meaningful on the data while embodying the structuredon the data while embodying the structured principles of encapsulation and data hiding. In this sectionprinciples of encapsulation and data hiding. In this section we define the basic parts of an ADT.we define the basic parts of an ADT. •Atomic and Composite Data •Data Type •Data Structure •Abstract Data Type
  • 6. Data Structures: A Pseudocode Approach with C, Second Edition6
  • 7. Data Structures: A Pseudocode Approach with C, Second Edition7 Data Structure Aggregation of atomic and composite data into a set with defined relationships. Structure refers to a set of rules that hold the data together. • A combination of elements in which each is either a data type or another data structure. • A set of associations of relationship involving combined elements. Example:
  • 8. Data Structures: A Pseudocode Approach with C, Second Edition8
  • 9. Data Structures: A Pseudocode Approach with C, Second Edition9 Abstract Data Type  ADT users are NOT concerned with how the task is done but rather what it can do.  An abstract data type is a data declaration packaged together with the operations that are meaningful for the data type.  We encapsulate the data and the operations on the data, and then hide them from the user.  All references to and manipulation of the data in a data structure are handled through defined interfaces to the structure.
  • 10. Data Structures: A Pseudocode Approach with C, Second Edition10 Model for an Abstract Data Type In this section we provide a conceptual model for an Abstract Data Type (ADT). • ADT Operation – passage like • ADT Data Structure – controlled entirely
  • 11. Data Structures: A Pseudocode Approach with C, Second Edition11
  • 12. Data Structures: A Pseudocode Approach with C, Second Edition12 ADT Implementations There are two basic structures we can use to implement an ADT list: arrays and linked lists. In this section we discuss the basic linked-list implementation. • Array Implementation • Linked List Implemenation
  • 13. Data Structures: A Pseudocode Approach with C, Second Edition13
  • 14. Data Structures: A Pseudocode Approach with C, Second Edition14
  • 15. Data Structures: A Pseudocode Approach with C, Second Edition15
  • 16. Data Structures: A Pseudocode Approach with C, Second Edition16 Generic Code for ADT In this section we discuss and provide examples of two C tools that are required to implement an ADT. • Pointer to Void • Pointer to Function
  • 17. Data Structures: A Pseudocode Approach with C, Second Edition17
  • 18. Data Structures: A Pseudocode Approach with C, Second Edition18
  • 19. Data Structures: A Pseudocode Approach with C, Second Edition19
  • 20. Data Structures: A Pseudocode Approach with C, Second Edition20
  • 21. Data Structures: A Pseudocode Approach with C, Second Edition21 (Continued)
  • 22. Data Structures: A Pseudocode Approach with C, Second Edition22
  • 23. Data Structures: A Pseudocode Approach with C, Second Edition23
  • 24. Data Structures: A Pseudocode Approach with C, Second Edition24
  • 25. Data Structures: A Pseudocode Approach with C, Second Edition25
  • 26. Data Structures: A Pseudocode Approach with C, Second Edition26 (Continued)
  • 27. Data Structures: A Pseudocode Approach with C, Second Edition27
  • 28. Data Structures: A Pseudocode Approach with C, Second Edition28
  • 29. Data Structures: A Pseudocode Approach with C, Second Edition29
  • 30. Data Structures: A Pseudocode Approach with C, Second Edition30
  • 31. Data Structures: A Pseudocode Approach with C, Second Edition31
  • 32. Data Structures: A Pseudocode Approach with C, Second Edition32
  • 33. Data Structures: A Pseudocode Approach with C, Second Edition33
  • 34. Data Structures: A Pseudocode Approach with C, Second Edition34
  • 35. Data Structures: A Pseudocode Approach with C, Second Edition35 Algorithm Efficiency To design and implement algorithms, programmersTo design and implement algorithms, programmers must have a basic understanding of what constitutesmust have a basic understanding of what constitutes good, efficient algorithms.good, efficient algorithms. Linear Loops -Efficiency is a function of the number of intstructions. - Loop update either adds or subtracts. • Logarithmic Loops -The controlling variable is either multiplied or divided in each iteration. - The number of iteration is a function of the multiplier or divisor. • Nested Loops - The number of iterations is the total number which is the product of the number of iterations in the inner loop and number of iterations in the outer loop. • Big-O Notation -Not concerned with exact measurement of efficiency but with the magnitude. - A dominant factor determines the magnitute.