SlideShare une entreprise Scribd logo
1  sur  49
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
1
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
 Understand the well-defined, clear, and simple approach
of program design
 Learn fundamental aspects of algorithm and its
characteristics
 Learn basic concepts such as data, data type, data
object, data structure, etc.
 Know the power of Abstract Data Type (ADT)
 Study about Software Development Life Cycle (SDLC)
2
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
3
Program Data
Computer
Output
Fig 1: Processing a Program
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
4
 Machine Language
 Assembly Language
 High-level Language
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
 OOP is used to model the real world through objects
 Object-oriented decomposition views software as a set of
well-defined objects that model entities in the application
domain
 These objects interact with each other to form a software
system
5
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
 Data
 Data Type
 Data Object
 Data structure
 Abstract Data Types (ADT)
6
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
7
 Data is nothing but a piece of information
 Data input, data manipulation (or data processing)
and data output are the themes of computer
 The address of the ith element is calculated by the
following formula
Atomic Data
Composite Data
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
8
 Data type is a term that specifies the type of data that a
variable may hold in the programming language
Built-in Data Types
User Defined Data Types
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
9
 A Data Object represents a container for data values
a place where data values may be stored
and later retrieved
 Data Object is runtime instance of data structure
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
10
 A combination of elements each of which is either a data
type or another data structure and
 A set of associations or relationships (structures)
involving the combined elements
 A data structure is a set of domains D, a designated
domain d Î D, a set of function F, and a set of axioms A
 The triple (D, F, A) denotes the data structure d and it will
usually be written as d
A Data Structure is
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
11
 An Abstract Data Type is a data declaration packaged
together with the operations that are meaningful for the
data type
 Abstract Data Type includes declaration of data,
implementation of operations, and encapsulation of
data and operations
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
 Primitive and Non-Primitive Data Structures
 Linear and Non-linear Data Structures
 Static and Dynamic
 Persistent and Ephemeral Data Structures
 Sequential Access and Direct Access Data Structures
12
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
13
 A Data Structure is said to be linear if its
elements form a sequence or a linear list
 Linear Data Structure, every data element has
unique successor and unique predecessor
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
14
 In non-linear data structures, every data element
may have more than one predecessor as well as
successor
 Elements do not form any particular linear
sequence
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
15
 Characteristics of Algorithm
 Algorithmic
 Design Tools
 Pseudo Code
 Flow chart
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
16
 The step-by-step solution is called an Algorithm
 Algorithm is independent of computer system and
programming language
 The real world performance of any software depends on two
things
The algorithm chosen, and
The suitability and efficiency of various layers of
implementation
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
17
 Input
 Output
 Unambiguous Steps
 Finiteness
 Effectiveness
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
 How to devise algorithms
 How to validate algorithms
 How to analyze algorithms
18
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
 Pseudo code Notations
 Algorithm Header
 Purpose
 Conditions and Return Statement
 Statement Numbers
 Variables
 Statement Constructs
 Sub Algorithms
19
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
 Sequence
 Decision
 Repetition
20
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
21
Figure 2: Sequence construct
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
22
Figure 3: Decision Construct
If a condition is true,
Then
Else
Algorithm
Purpose :Comparing two numbers
Pre: None
Post: None
Return: None
1) Read two numbers Num1 and Num2
2) If Num1 > Num2
a. Then Print Num1
b. Else Print Num2
3) Stop
Series of Actions
Series of Actions
Example
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
23
Figure 3: Decision Construct
If a condition is true,
Then
Algorithm
Purpose :Comparing two numbers
Pre: None
Post: None
Return: None
1) Read two numbers Num1 and Num2
2) If Num1 > Num2
a. Then Print Num1
b. Else Print Num2
3) Stop
Series of Actions
Series of Actions
Example
24
Data Structures in C++ by Dr. Varsha Patil Oxford University Press © 2012
Figure 4: Repetition Construct
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
25
Relationship between Data, Data
Structures, and Algorithms
 A data structure represents a set of data items with
a specific relationship between them.
 The success of a software project often depends
upon the choices made in the representation of
data and algorithms designed to process the data
 The proper choice of a data structure can be a key
point in the design of many algorithms
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
26
 Specification
 Implementation
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
27
 A very effective tool to show the logic flow of a program
 A flow chart is a pictorial representation of an algorithm.
 It hides all of the details of an algorithm by giving the
picture;
 It shows how the algorithm flows from beginning to end
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
28
Figure 5: Flow chart for adding three
numbers
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
29
 Complexity of Algorithms
 Space Complexity
 Time Complexity
 Computing Time Complexity of Algorithm
 Big-O Notation
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
30
 Amount of computer memory required during the
program execution, as a function of the input size
 Space complexity measurement which is space
requirement of an algorithm can be done at two different
times:
 Compile time and
 Execution time
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
31
 Compile Time Space Complexity is defined as the
storage requirement of a program at compile time
 Space Complexity = Space needed of compile time
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
32
 If program is recursive or uses dynamic variables or
dynamic data structure then there is a need to determine
space complexity at runtime
 The memory requirement is summation of the
 Program Space
 Data Space And
 Stack Space
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
33
 Time Complexity of an algorithm is a measure of how
much time is required to execute an algorithm for a given
number of inputs
 Time Complexity T(P) is the time taken by program P
and the sum of the compile and execution time
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
34
 Worst Case
Complexity of the algorithm is the function defined
by the maximum number of steps taken on any instance
of size n
 Best Case
Complexity of the algorithm is the function defined
by the minimum number of steps taken on any instance
of size n
 Average Case
Complexity of the algorithm is the function defined
by an average number of steps taken on any instance of
size n
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
35
 The total time taken by the algorithm or program is
calculated using the sum of the time taken by each of
executable statement in algorithm or program
 Time required by each statement depends on
 Time required for executing it once
 Number of times the statement is executed
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
36
Software Engineering
 Software Engineering is the establishment
and use of sound engineering methods
 and principles to obtain reliable software that
works on real machines
 A fundamental concept in Software
Engineering is the Software Development
Life Cycle (SDLC)
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
37
Software Engineering
 Analysis Phase
 Design Phase
 Implementation Phase
 Testing Phase
 Verification
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
38
Figure 6: System Development Phases
Software Engineering
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
39
Analysis Phase
 Define the User
 Define the Needs
 Define the Requirements
 Define the Methods
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
40
Design Phase
 Modularity
The design phase uses a very well-
established principle called Modularity
The whole package is divided into small
modules
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
41
Implementation Phase
Tools
 Flowchart
 Pseudo Code
 Coding
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
42
Testing Phase
Testing Phase
Once the programs have been written, they must be
tested.
There are two types of testing:
 Black Box
 White Box
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
43
Verification
 Program verification is a process to prove that
the program does what it is intended to do
 It is said that 'even verification must be verified'
 This means, along with system, tests made are
to be verified
 Also, every software quality must be verified
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
44
KEY TERMS
 DATA
 DATA TYPE
 DATA OBJECT
 DATA STRUCTURE
 ABSTRACT DATA TYPE
 LINEAR DATA STRUCUTRE
 NON LINEAR DATA STRUCTURE
 ALGORITHM
 ASSEMBLER
 COMPILER
 PROGRAM
 PSEUDOCODE
 FLOWCHART
 SOFTWARE ENGINEERING
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
45
Summary
 Computer is a programmable data processing machine that accepts
input; instructions to process input (program) and generates
required output. Data and program are stored in computer’s
memory. A program is written in computer’s language.
 The art of programming consists of designing or choosing
algorithms and expressing them in a programming language. An
algorithm is a stepwise description of action which leads the
problem from its start state to its goal state
 One of the common tools used to define algorithms is pseudo code.
Pseudo code is an English-like representation of the code required
for an algorithm. It is part of English, part structured code
 A very effective tool to show the logic flow of a program is the flow
chart. A flow chart is a pictorial representation of an algorithm. It
hides all of the details of an algorithm by giving the picture; it
shows how the algorithm flows from beginning to end
 Program verification is a process to prove that the program does
what it is intended to do
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
46
Summary
 Engineering is the establishment and use of sound
engineering methods and principles to obtain reliable
software that works on real machines
 A data structure represents a set of data items with a specific
relationship between them. The success of a software project
often depends upon the choices made in the representation
of data and algorithms designed to process the data. The
proper choice of a data structure can be a key point in the
design of many algorithms
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
47
Summary
 The various types Software Engineering is the establishment
and use of sound engineering methodologies and the
principle to writing reliable of data structures are:
 Primitive and Non-primitive data structures
 Linear and Non-linear data structures
 Static and Dynamic data structures
 Persistent and Ephemeral data structures
 Sequential and Direct access data structures
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
48
Summary
 There is an intimate relationship between the structuring of data, and
analysis of algorithms. In fact, a data structure and an algorithm should
be thought of as a one single unit, neither one along making sense
without the other. · Algorithms heavily depend on the organization of
data
 There can be several organizations of data and/or algorithms for a
given problem. Difficulty lies in deciding which algorithms is the best.
We can compare one algorithm with other and choose the best. For
comparison we need to analyze algorithms. Analysis involves
measuring the performance of an algorithm in terms of time and space
complexity
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
49

Contenu connexe

Tendances

Data Structure and its Fundamentals
Data Structure and its FundamentalsData Structure and its Fundamentals
Data Structure and its FundamentalsHitesh Mohapatra
 
Queue in Data Structure
Queue in Data Structure Queue in Data Structure
Queue in Data Structure Janki Shah
 
04 brute force
04 brute force04 brute force
04 brute forceHira Gul
 
trees in data structure
trees in data structure trees in data structure
trees in data structure shameen khan
 
Graph representation
Graph representationGraph representation
Graph representationTech_MX
 
Python Variable Types, List, Tuple, Dictionary
Python Variable Types, List, Tuple, DictionaryPython Variable Types, List, Tuple, Dictionary
Python Variable Types, List, Tuple, DictionarySoba Arjun
 
Data Structures and Algorithm Analysis
Data Structures  and  Algorithm AnalysisData Structures  and  Algorithm Analysis
Data Structures and Algorithm AnalysisMary Margarat
 
Introduction to data structure ppt
Introduction to data structure pptIntroduction to data structure ppt
Introduction to data structure pptNalinNishant3
 
3. Stack - Data Structures using C++ by Varsha Patil
3. Stack - Data Structures using C++ by Varsha Patil3. Stack - Data Structures using C++ by Varsha Patil
3. Stack - Data Structures using C++ by Varsha Patilwidespreadpromotion
 
Sorting Algorithms
Sorting AlgorithmsSorting Algorithms
Sorting AlgorithmsPranay Neema
 
Binary Search Tree in Data Structure
Binary Search Tree in Data StructureBinary Search Tree in Data Structure
Binary Search Tree in Data StructureMeghaj Mallick
 
Bruteforce algorithm
Bruteforce algorithmBruteforce algorithm
Bruteforce algorithmRezwan Siam
 
Data structures and algorithms
Data structures and algorithmsData structures and algorithms
Data structures and algorithmsJulie Iskander
 
TYPES DATA STRUCTURES( LINEAR AND NON LINEAR)....
TYPES DATA STRUCTURES( LINEAR AND NON LINEAR)....TYPES DATA STRUCTURES( LINEAR AND NON LINEAR)....
TYPES DATA STRUCTURES( LINEAR AND NON LINEAR)....Shail Nakum
 
Searching and Sorting Techniques in Data Structure
Searching and Sorting Techniques in Data StructureSearching and Sorting Techniques in Data Structure
Searching and Sorting Techniques in Data StructureBalwant Gorad
 
Selection sort
Selection sortSelection sort
Selection sortstella D
 

Tendances (20)

Data Structure and its Fundamentals
Data Structure and its FundamentalsData Structure and its Fundamentals
Data Structure and its Fundamentals
 
Complexity of Algorithm
Complexity of AlgorithmComplexity of Algorithm
Complexity of Algorithm
 
Queue in Data Structure
Queue in Data Structure Queue in Data Structure
Queue in Data Structure
 
04 brute force
04 brute force04 brute force
04 brute force
 
trees in data structure
trees in data structure trees in data structure
trees in data structure
 
Graph representation
Graph representationGraph representation
Graph representation
 
Python Variable Types, List, Tuple, Dictionary
Python Variable Types, List, Tuple, DictionaryPython Variable Types, List, Tuple, Dictionary
Python Variable Types, List, Tuple, Dictionary
 
Data Structures and Algorithm Analysis
Data Structures  and  Algorithm AnalysisData Structures  and  Algorithm Analysis
Data Structures and Algorithm Analysis
 
Insertion Sorting
Insertion SortingInsertion Sorting
Insertion Sorting
 
Introduction to data structure ppt
Introduction to data structure pptIntroduction to data structure ppt
Introduction to data structure ppt
 
3. Stack - Data Structures using C++ by Varsha Patil
3. Stack - Data Structures using C++ by Varsha Patil3. Stack - Data Structures using C++ by Varsha Patil
3. Stack - Data Structures using C++ by Varsha Patil
 
Sorting Algorithms
Sorting AlgorithmsSorting Algorithms
Sorting Algorithms
 
Binary Search Tree in Data Structure
Binary Search Tree in Data StructureBinary Search Tree in Data Structure
Binary Search Tree in Data Structure
 
Bruteforce algorithm
Bruteforce algorithmBruteforce algorithm
Bruteforce algorithm
 
Data structures and algorithms
Data structures and algorithmsData structures and algorithms
Data structures and algorithms
 
TYPES DATA STRUCTURES( LINEAR AND NON LINEAR)....
TYPES DATA STRUCTURES( LINEAR AND NON LINEAR)....TYPES DATA STRUCTURES( LINEAR AND NON LINEAR)....
TYPES DATA STRUCTURES( LINEAR AND NON LINEAR)....
 
Searching and Sorting Techniques in Data Structure
Searching and Sorting Techniques in Data StructureSearching and Sorting Techniques in Data Structure
Searching and Sorting Techniques in Data Structure
 
Data structures using c
Data structures using cData structures using c
Data structures using c
 
Selection sort
Selection sortSelection sort
Selection sort
 
Data Structure and Algorithms
Data Structure and AlgorithmsData Structure and Algorithms
Data Structure and Algorithms
 

En vedette

4. Recursion - Data Structures using C++ by Varsha Patil
4. Recursion - Data Structures using C++ by Varsha Patil4. Recursion - Data Structures using C++ by Varsha Patil
4. Recursion - Data Structures using C++ by Varsha Patilwidespreadpromotion
 
7. Tree - Data Structures using C++ by Varsha Patil
7. Tree - Data Structures using C++ by Varsha Patil7. Tree - Data Structures using C++ by Varsha Patil
7. Tree - Data Structures using C++ by Varsha Patilwidespreadpromotion
 
6. Linked list - Data Structures using C++ by Varsha Patil
6. Linked list - Data Structures using C++ by Varsha Patil6. Linked list - Data Structures using C++ by Varsha Patil
6. Linked list - Data Structures using C++ by Varsha Patilwidespreadpromotion
 
Discrete Mathematics S. Lipschutz, M. Lipson And V. H. Patil
Discrete Mathematics S. Lipschutz, M. Lipson And V. H. PatilDiscrete Mathematics S. Lipschutz, M. Lipson And V. H. Patil
Discrete Mathematics S. Lipschutz, M. Lipson And V. H. Patilwidespreadpromotion
 
5. Queue - Data Structures using C++ by Varsha Patil
5. Queue - Data Structures using C++ by Varsha Patil5. Queue - Data Structures using C++ by Varsha Patil
5. Queue - Data Structures using C++ by Varsha Patilwidespreadpromotion
 
10. Search Tree - Data Structures using C++ by Varsha Patil
10. Search Tree - Data Structures using C++ by Varsha Patil10. Search Tree - Data Structures using C++ by Varsha Patil
10. Search Tree - Data Structures using C++ by Varsha Patilwidespreadpromotion
 
Data Structure
Data StructureData Structure
Data Structuresheraz1
 
stacks in algorithems and data structure
stacks in algorithems and data structurestacks in algorithems and data structure
stacks in algorithems and data structurefaran nawaz
 
8. Graph - Data Structures using C++ by Varsha Patil
8. Graph - Data Structures using C++ by Varsha Patil8. Graph - Data Structures using C++ by Varsha Patil
8. Graph - Data Structures using C++ by Varsha Patilwidespreadpromotion
 
12. Heaps - Data Structures using C++ by Varsha Patil
12. Heaps - Data Structures using C++ by Varsha Patil12. Heaps - Data Structures using C++ by Varsha Patil
12. Heaps - Data Structures using C++ by Varsha Patilwidespreadpromotion
 
មេរៀនៈ Data Structure and Algorithm in C/C++
មេរៀនៈ Data Structure and Algorithm in C/C++មេរៀនៈ Data Structure and Algorithm in C/C++
មេរៀនៈ Data Structure and Algorithm in C/C++Ngeam Soly
 
9. Searching & Sorting - Data Structures using C++ by Varsha Patil
9. Searching & Sorting - Data Structures using C++ by Varsha Patil9. Searching & Sorting - Data Structures using C++ by Varsha Patil
9. Searching & Sorting - Data Structures using C++ by Varsha Patilwidespreadpromotion
 
Database structure Structures Link list and trees and Recurison complete
Database structure Structures Link list and trees and Recurison complete  Database structure Structures Link list and trees and Recurison complete
Database structure Structures Link list and trees and Recurison complete Adnan abid
 
Concept Of C++ Data Types
Concept Of C++ Data TypesConcept Of C++ Data Types
Concept Of C++ Data Typesk v
 
Fundamentals of data structures
Fundamentals of data structuresFundamentals of data structures
Fundamentals of data structuresNiraj Agarwal
 
Preparation Data Structures 03 abstract data_types
Preparation Data Structures 03 abstract data_typesPreparation Data Structures 03 abstract data_types
Preparation Data Structures 03 abstract data_typesAndres Mendez-Vazquez
 

En vedette (20)

4. Recursion - Data Structures using C++ by Varsha Patil
4. Recursion - Data Structures using C++ by Varsha Patil4. Recursion - Data Structures using C++ by Varsha Patil
4. Recursion - Data Structures using C++ by Varsha Patil
 
7. Tree - Data Structures using C++ by Varsha Patil
7. Tree - Data Structures using C++ by Varsha Patil7. Tree - Data Structures using C++ by Varsha Patil
7. Tree - Data Structures using C++ by Varsha Patil
 
6. Linked list - Data Structures using C++ by Varsha Patil
6. Linked list - Data Structures using C++ by Varsha Patil6. Linked list - Data Structures using C++ by Varsha Patil
6. Linked list - Data Structures using C++ by Varsha Patil
 
Discrete Mathematics S. Lipschutz, M. Lipson And V. H. Patil
Discrete Mathematics S. Lipschutz, M. Lipson And V. H. PatilDiscrete Mathematics S. Lipschutz, M. Lipson And V. H. Patil
Discrete Mathematics S. Lipschutz, M. Lipson And V. H. Patil
 
5. Queue - Data Structures using C++ by Varsha Patil
5. Queue - Data Structures using C++ by Varsha Patil5. Queue - Data Structures using C++ by Varsha Patil
5. Queue - Data Structures using C++ by Varsha Patil
 
10. Search Tree - Data Structures using C++ by Varsha Patil
10. Search Tree - Data Structures using C++ by Varsha Patil10. Search Tree - Data Structures using C++ by Varsha Patil
10. Search Tree - Data Structures using C++ by Varsha Patil
 
Data Structure
Data StructureData Structure
Data Structure
 
stacks in algorithems and data structure
stacks in algorithems and data structurestacks in algorithems and data structure
stacks in algorithems and data structure
 
8. Graph - Data Structures using C++ by Varsha Patil
8. Graph - Data Structures using C++ by Varsha Patil8. Graph - Data Structures using C++ by Varsha Patil
8. Graph - Data Structures using C++ by Varsha Patil
 
12. Heaps - Data Structures using C++ by Varsha Patil
12. Heaps - Data Structures using C++ by Varsha Patil12. Heaps - Data Structures using C++ by Varsha Patil
12. Heaps - Data Structures using C++ by Varsha Patil
 
មេរៀនៈ Data Structure and Algorithm in C/C++
មេរៀនៈ Data Structure and Algorithm in C/C++មេរៀនៈ Data Structure and Algorithm in C/C++
មេរៀនៈ Data Structure and Algorithm in C/C++
 
9. Searching & Sorting - Data Structures using C++ by Varsha Patil
9. Searching & Sorting - Data Structures using C++ by Varsha Patil9. Searching & Sorting - Data Structures using C++ by Varsha Patil
9. Searching & Sorting - Data Structures using C++ by Varsha Patil
 
Database structure Structures Link list and trees and Recurison complete
Database structure Structures Link list and trees and Recurison complete  Database structure Structures Link list and trees and Recurison complete
Database structure Structures Link list and trees and Recurison complete
 
Concept Of C++ Data Types
Concept Of C++ Data TypesConcept Of C++ Data Types
Concept Of C++ Data Types
 
Fundamentals of data structures
Fundamentals of data structuresFundamentals of data structures
Fundamentals of data structures
 
Lec27
Lec27Lec27
Lec27
 
Preparation Data Structures 03 abstract data_types
Preparation Data Structures 03 abstract data_typesPreparation Data Structures 03 abstract data_types
Preparation Data Structures 03 abstract data_types
 
Lec3
Lec3Lec3
Lec3
 
Ch17
Ch17Ch17
Ch17
 
Chapter03
Chapter03Chapter03
Chapter03
 

Similaire à 1. Fundamental Concept - Data Structures using C++ by Varsha Patil

15. STL - Data Structures using C++ by Varsha Patil
15. STL - Data Structures using C++ by Varsha Patil15. STL - Data Structures using C++ by Varsha Patil
15. STL - Data Structures using C++ by Varsha Patilwidespreadpromotion
 
16. Algo analysis & Design - Data Structures using C++ by Varsha Patil
16. Algo analysis & Design - Data Structures using C++ by Varsha Patil16. Algo analysis & Design - Data Structures using C++ by Varsha Patil
16. Algo analysis & Design - Data Structures using C++ by Varsha Patilwidespreadpromotion
 
Data Science as a Service: Intersection of Cloud Computing and Data Science
Data Science as a Service: Intersection of Cloud Computing and Data ScienceData Science as a Service: Intersection of Cloud Computing and Data Science
Data Science as a Service: Intersection of Cloud Computing and Data SciencePouria Amirian
 
Data Science as a Service: Intersection of Cloud Computing and Data Science
Data Science as a Service: Intersection of Cloud Computing and Data ScienceData Science as a Service: Intersection of Cloud Computing and Data Science
Data Science as a Service: Intersection of Cloud Computing and Data SciencePouria Amirian
 
Oop lec 2(introduction to object oriented technology)
Oop lec 2(introduction to object oriented technology)Oop lec 2(introduction to object oriented technology)
Oop lec 2(introduction to object oriented technology)Asfand Hassan
 
Final Project presentation (on App devlopment)
Final Project presentation (on App devlopment)Final Project presentation (on App devlopment)
Final Project presentation (on App devlopment)S.M. Fazla Rabbi
 
Decision Making Framework in e-Business Cloud Environment Using Software Metr...
Decision Making Framework in e-Business Cloud Environment Using Software Metr...Decision Making Framework in e-Business Cloud Environment Using Software Metr...
Decision Making Framework in e-Business Cloud Environment Using Software Metr...ijitjournal
 
Regression with Microsoft Azure & Ms Excel
Regression with Microsoft Azure & Ms ExcelRegression with Microsoft Azure & Ms Excel
Regression with Microsoft Azure & Ms ExcelDr. Abdul Ahad Abro
 
Project Evaluation and Estimation in Software Development
Project Evaluation and Estimation in Software DevelopmentProject Evaluation and Estimation in Software Development
Project Evaluation and Estimation in Software DevelopmentProf Ansari
 
Dsc -session01_introduction_to_data_structures_v2_1_.2
Dsc  -session01_introduction_to_data_structures_v2_1_.2Dsc  -session01_introduction_to_data_structures_v2_1_.2
Dsc -session01_introduction_to_data_structures_v2_1_.2sivakumar323849
 
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-paradigmIIUM
 
ICT DBA3 03 0710 Designing a Database.pptx
ICT DBA3 03 0710 Designing a Database.pptxICT DBA3 03 0710 Designing a Database.pptx
ICT DBA3 03 0710 Designing a Database.pptxInfotech27
 
Data analytics using R programming
Data analytics using R programmingData analytics using R programming
Data analytics using R programmingUmang Singh
 

Similaire à 1. Fundamental Concept - Data Structures using C++ by Varsha Patil (20)

15. STL - Data Structures using C++ by Varsha Patil
15. STL - Data Structures using C++ by Varsha Patil15. STL - Data Structures using C++ by Varsha Patil
15. STL - Data Structures using C++ by Varsha Patil
 
16. Algo analysis & Design - Data Structures using C++ by Varsha Patil
16. Algo analysis & Design - Data Structures using C++ by Varsha Patil16. Algo analysis & Design - Data Structures using C++ by Varsha Patil
16. Algo analysis & Design - Data Structures using C++ by Varsha Patil
 
Data Science as a Service: Intersection of Cloud Computing and Data Science
Data Science as a Service: Intersection of Cloud Computing and Data ScienceData Science as a Service: Intersection of Cloud Computing and Data Science
Data Science as a Service: Intersection of Cloud Computing and Data Science
 
Data Science as a Service: Intersection of Cloud Computing and Data Science
Data Science as a Service: Intersection of Cloud Computing and Data ScienceData Science as a Service: Intersection of Cloud Computing and Data Science
Data Science as a Service: Intersection of Cloud Computing and Data Science
 
Lec1
Lec1Lec1
Lec1
 
Lecture 1.pptx
Lecture 1.pptxLecture 1.pptx
Lecture 1.pptx
 
Oop lec 2(introduction to object oriented technology)
Oop lec 2(introduction to object oriented technology)Oop lec 2(introduction to object oriented technology)
Oop lec 2(introduction to object oriented technology)
 
Final Project presentation (on App devlopment)
Final Project presentation (on App devlopment)Final Project presentation (on App devlopment)
Final Project presentation (on App devlopment)
 
Ch7
Ch7Ch7
Ch7
 
Ch7
Ch7Ch7
Ch7
 
Final
FinalFinal
Final
 
Chapter 1- IT.pptx
Chapter 1- IT.pptxChapter 1- IT.pptx
Chapter 1- IT.pptx
 
Decision Making Framework in e-Business Cloud Environment Using Software Metr...
Decision Making Framework in e-Business Cloud Environment Using Software Metr...Decision Making Framework in e-Business Cloud Environment Using Software Metr...
Decision Making Framework in e-Business Cloud Environment Using Software Metr...
 
Regression with Microsoft Azure & Ms Excel
Regression with Microsoft Azure & Ms ExcelRegression with Microsoft Azure & Ms Excel
Regression with Microsoft Azure & Ms Excel
 
Project Evaluation and Estimation in Software Development
Project Evaluation and Estimation in Software DevelopmentProject Evaluation and Estimation in Software Development
Project Evaluation and Estimation in Software Development
 
Dsc -session01_introduction_to_data_structures_v2_1_.2
Dsc  -session01_introduction_to_data_structures_v2_1_.2Dsc  -session01_introduction_to_data_structures_v2_1_.2
Dsc -session01_introduction_to_data_structures_v2_1_.2
 
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
 
ICT DBA3 03 0710 Designing a Database.pptx
ICT DBA3 03 0710 Designing a Database.pptxICT DBA3 03 0710 Designing a Database.pptx
ICT DBA3 03 0710 Designing a Database.pptx
 
Data analytics using R programming
Data analytics using R programmingData analytics using R programming
Data analytics using R programming
 

Dernier

Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...amitlee9823
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Researchmichael115558
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteedamy56318795
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionfulawalesam
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...amitlee9823
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAroojKhan71
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFxolyaivanovalion
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfMarinCaroMartnezBerg
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysismanisha194592
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...amitlee9823
 
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...amitlee9823
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...amitlee9823
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz1
 
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...amitlee9823
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxolyaivanovalion
 
Capstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics ProgramCapstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics ProgramMoniSankarHazra
 
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceDelhi Call girls
 
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfadriantubila
 

Dernier (20)

Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Research
 
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interaction
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFx
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysis
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
 
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signals
 
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFx
 
Anomaly detection and data imputation within time series
Anomaly detection and data imputation within time seriesAnomaly detection and data imputation within time series
Anomaly detection and data imputation within time series
 
Capstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics ProgramCapstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics Program
 
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
 
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
 

1. Fundamental Concept - Data Structures using C++ by Varsha Patil

  • 1. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 1
  • 2. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil  Understand the well-defined, clear, and simple approach of program design  Learn fundamental aspects of algorithm and its characteristics  Learn basic concepts such as data, data type, data object, data structure, etc.  Know the power of Abstract Data Type (ADT)  Study about Software Development Life Cycle (SDLC) 2
  • 3. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 3 Program Data Computer Output Fig 1: Processing a Program
  • 4. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 4  Machine Language  Assembly Language  High-level Language
  • 5. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil  OOP is used to model the real world through objects  Object-oriented decomposition views software as a set of well-defined objects that model entities in the application domain  These objects interact with each other to form a software system 5
  • 6. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil  Data  Data Type  Data Object  Data structure  Abstract Data Types (ADT) 6
  • 7. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 7  Data is nothing but a piece of information  Data input, data manipulation (or data processing) and data output are the themes of computer  The address of the ith element is calculated by the following formula Atomic Data Composite Data
  • 8. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 8  Data type is a term that specifies the type of data that a variable may hold in the programming language Built-in Data Types User Defined Data Types
  • 9. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 9  A Data Object represents a container for data values a place where data values may be stored and later retrieved  Data Object is runtime instance of data structure
  • 10. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 10  A combination of elements each of which is either a data type or another data structure and  A set of associations or relationships (structures) involving the combined elements  A data structure is a set of domains D, a designated domain d Î D, a set of function F, and a set of axioms A  The triple (D, F, A) denotes the data structure d and it will usually be written as d A Data Structure is
  • 11. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 11  An Abstract Data Type is a data declaration packaged together with the operations that are meaningful for the data type  Abstract Data Type includes declaration of data, implementation of operations, and encapsulation of data and operations
  • 12. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil  Primitive and Non-Primitive Data Structures  Linear and Non-linear Data Structures  Static and Dynamic  Persistent and Ephemeral Data Structures  Sequential Access and Direct Access Data Structures 12
  • 13. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 13  A Data Structure is said to be linear if its elements form a sequence or a linear list  Linear Data Structure, every data element has unique successor and unique predecessor
  • 14. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 14  In non-linear data structures, every data element may have more than one predecessor as well as successor  Elements do not form any particular linear sequence
  • 15. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 15  Characteristics of Algorithm  Algorithmic  Design Tools  Pseudo Code  Flow chart
  • 16. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 16  The step-by-step solution is called an Algorithm  Algorithm is independent of computer system and programming language  The real world performance of any software depends on two things The algorithm chosen, and The suitability and efficiency of various layers of implementation
  • 17. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 17  Input  Output  Unambiguous Steps  Finiteness  Effectiveness
  • 18. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil  How to devise algorithms  How to validate algorithms  How to analyze algorithms 18
  • 19. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil  Pseudo code Notations  Algorithm Header  Purpose  Conditions and Return Statement  Statement Numbers  Variables  Statement Constructs  Sub Algorithms 19
  • 20. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil  Sequence  Decision  Repetition 20
  • 21. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 21 Figure 2: Sequence construct
  • 22. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 22 Figure 3: Decision Construct If a condition is true, Then Else Algorithm Purpose :Comparing two numbers Pre: None Post: None Return: None 1) Read two numbers Num1 and Num2 2) If Num1 > Num2 a. Then Print Num1 b. Else Print Num2 3) Stop Series of Actions Series of Actions Example
  • 23. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 23 Figure 3: Decision Construct If a condition is true, Then Algorithm Purpose :Comparing two numbers Pre: None Post: None Return: None 1) Read two numbers Num1 and Num2 2) If Num1 > Num2 a. Then Print Num1 b. Else Print Num2 3) Stop Series of Actions Series of Actions Example
  • 24. 24 Data Structures in C++ by Dr. Varsha Patil Oxford University Press © 2012 Figure 4: Repetition Construct
  • 25. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 25 Relationship between Data, Data Structures, and Algorithms  A data structure represents a set of data items with a specific relationship between them.  The success of a software project often depends upon the choices made in the representation of data and algorithms designed to process the data  The proper choice of a data structure can be a key point in the design of many algorithms
  • 26. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 26  Specification  Implementation
  • 27. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 27  A very effective tool to show the logic flow of a program  A flow chart is a pictorial representation of an algorithm.  It hides all of the details of an algorithm by giving the picture;  It shows how the algorithm flows from beginning to end
  • 28. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 28 Figure 5: Flow chart for adding three numbers
  • 29. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 29  Complexity of Algorithms  Space Complexity  Time Complexity  Computing Time Complexity of Algorithm  Big-O Notation
  • 30. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 30  Amount of computer memory required during the program execution, as a function of the input size  Space complexity measurement which is space requirement of an algorithm can be done at two different times:  Compile time and  Execution time
  • 31. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 31  Compile Time Space Complexity is defined as the storage requirement of a program at compile time  Space Complexity = Space needed of compile time
  • 32. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 32  If program is recursive or uses dynamic variables or dynamic data structure then there is a need to determine space complexity at runtime  The memory requirement is summation of the  Program Space  Data Space And  Stack Space
  • 33. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 33  Time Complexity of an algorithm is a measure of how much time is required to execute an algorithm for a given number of inputs  Time Complexity T(P) is the time taken by program P and the sum of the compile and execution time
  • 34. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 34  Worst Case Complexity of the algorithm is the function defined by the maximum number of steps taken on any instance of size n  Best Case Complexity of the algorithm is the function defined by the minimum number of steps taken on any instance of size n  Average Case Complexity of the algorithm is the function defined by an average number of steps taken on any instance of size n
  • 35. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 35  The total time taken by the algorithm or program is calculated using the sum of the time taken by each of executable statement in algorithm or program  Time required by each statement depends on  Time required for executing it once  Number of times the statement is executed
  • 36. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 36 Software Engineering  Software Engineering is the establishment and use of sound engineering methods  and principles to obtain reliable software that works on real machines  A fundamental concept in Software Engineering is the Software Development Life Cycle (SDLC)
  • 37. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 37 Software Engineering  Analysis Phase  Design Phase  Implementation Phase  Testing Phase  Verification
  • 38. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 38 Figure 6: System Development Phases Software Engineering
  • 39. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 39 Analysis Phase  Define the User  Define the Needs  Define the Requirements  Define the Methods
  • 40. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 40 Design Phase  Modularity The design phase uses a very well- established principle called Modularity The whole package is divided into small modules
  • 41. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 41 Implementation Phase Tools  Flowchart  Pseudo Code  Coding
  • 42. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 42 Testing Phase Testing Phase Once the programs have been written, they must be tested. There are two types of testing:  Black Box  White Box
  • 43. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 43 Verification  Program verification is a process to prove that the program does what it is intended to do  It is said that 'even verification must be verified'  This means, along with system, tests made are to be verified  Also, every software quality must be verified
  • 44. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 44 KEY TERMS  DATA  DATA TYPE  DATA OBJECT  DATA STRUCTURE  ABSTRACT DATA TYPE  LINEAR DATA STRUCUTRE  NON LINEAR DATA STRUCTURE  ALGORITHM  ASSEMBLER  COMPILER  PROGRAM  PSEUDOCODE  FLOWCHART  SOFTWARE ENGINEERING
  • 45. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 45 Summary  Computer is a programmable data processing machine that accepts input; instructions to process input (program) and generates required output. Data and program are stored in computer’s memory. A program is written in computer’s language.  The art of programming consists of designing or choosing algorithms and expressing them in a programming language. An algorithm is a stepwise description of action which leads the problem from its start state to its goal state  One of the common tools used to define algorithms is pseudo code. Pseudo code is an English-like representation of the code required for an algorithm. It is part of English, part structured code  A very effective tool to show the logic flow of a program is the flow chart. A flow chart is a pictorial representation of an algorithm. It hides all of the details of an algorithm by giving the picture; it shows how the algorithm flows from beginning to end  Program verification is a process to prove that the program does what it is intended to do
  • 46. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 46 Summary  Engineering is the establishment and use of sound engineering methods and principles to obtain reliable software that works on real machines  A data structure represents a set of data items with a specific relationship between them. The success of a software project often depends upon the choices made in the representation of data and algorithms designed to process the data. The proper choice of a data structure can be a key point in the design of many algorithms
  • 47. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 47 Summary  The various types Software Engineering is the establishment and use of sound engineering methodologies and the principle to writing reliable of data structures are:  Primitive and Non-primitive data structures  Linear and Non-linear data structures  Static and Dynamic data structures  Persistent and Ephemeral data structures  Sequential and Direct access data structures
  • 48. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 48 Summary  There is an intimate relationship between the structuring of data, and analysis of algorithms. In fact, a data structure and an algorithm should be thought of as a one single unit, neither one along making sense without the other. · Algorithms heavily depend on the organization of data  There can be several organizations of data and/or algorithms for a given problem. Difficulty lies in deciding which algorithms is the best. We can compare one algorithm with other and choose the best. For comparison we need to analyze algorithms. Analysis involves measuring the performance of an algorithm in terms of time and space complexity
  • 49. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 49