SlideShare ist ein Scribd-Unternehmen logo
1 von 18
What is Program 
 A Set of Instructions 
 Data Structures + Algorithms 
 Data Structure = A Container stores Data 
 Algorithm = Logic + Control 
Trupti Agrawal 1
DATA STRUCTURE 
 A data structure is a particular way of organizing data in a computer so that it can 
be used efficiently. 
 Different kinds of data structures are suited to different kinds of applications, and 
some are highly specialized to specific tasks. For example, B-trees are particularly 
well-suited for implementation of databases, while compiler implementations 
usually use hash table to look up identifiers. 
 Data structures provide a means to manage large amounts of data efficiently, such as 
large databases and internet indexing services. 
 Usually, efficient data structures are a key in designing efficient algorithms. 
 Some formal design methods and programming languages emphasize data 
structures, rather than algorithms, as the key organizing factor in software design. 
Storing and retrieving can be carried out on data stored in both main memory and 
in secondary memory.
Common Data Structures 
 Array 
 Stack 
 Queue 
 Linked List 
 Tree 
 Heap 
 Hash Table 
 Priority Queue
Introduction to Algorithm 
 An algorithm is a finite set of instructions that accomplishes 
a particular task. 
 Criteria 
 input: zero or more quantities that are externally supplied 
 output: at least one quantity is produced 
 definiteness: clear and unambiguous 
 finiteness: terminate after a finite number of steps 
 effectiveness: instruction is basic enough to be carried out 
 A program does not have to satisfy the finiteness criteria
[Cont…] 
 Representation 
 A natural language, like English or Chinese. 
 A graphic, like flowcharts. 
 A computer language, like C. 
 Algorithms + Data structures = Programs [NiklusWirth]
Designing an Algorithm 
 Requirements 
 Analysis: bottom-up vs. top-down 
 Design: data objects and operations 
 Refinement and Coding 
 Verification 
 Program Proving 
 Testing 
 Debugging
Approaches for Designing an 
Algorithm
Analysis of algorithms 
 In computer science, the analysis of algorithms is the determination 
of the number of resources (such as time and storage) necessary to 
execute them. 
 Most algorithms are designed to work with inputs of arbitrary length. 
Usually the efficiency or running time of an algorithm is stated as a 
function relating the input length to the number of steps (time 
complexity) or storage locations (space complexity). 
 Algorithm analysis is an important part of a broader computational 
complexity theory, which provides theoretical estimates for the 
resources needed by any algorithm which solves a 
given computational problem. These estimates provide an insight 
into reasonable directions of search for efficient algorithms.
Time complexity 
 In computer science, the time complexity of 
an algorithm quantifies the amount of time taken by an 
algorithm to run as a function of the length of 
the string representing the input. The time complexity of 
an algorithm is commonly expressed using big O notation, 
which excludes coefficients and lower order terms. When 
expressed this way, the time complexity is said to be 
described asymptotically, i.e., as the input size goes to 
infinity. For example, if the time required by an algorithm 
on all inputs of size n is at most 5n3 + 3n, the asymptotic 
time complexity is O(n3).
[Cont…] 
 Since an algorithm's performance time may vary with 
different inputs of the same size, one commonly uses 
the worst-case time complexity of an algorithm, denoted 
as T(n), which is defined as the maximum amount of time 
taken on any input of size n. Time complexities are 
classified by the nature of the function T(n). For instance, 
an algorithm with T(n) = O(n) is called a linear time 
algorithm, and an algorithm with T(n) = O(2n) is said to be 
an exponential time algorithm.
Space complexity 
 It represents the total amount of memory space that a 
"normal" physical computer would need to solve a 
given computational problem with a given algorithm. It is 
one of the most well-studied complexity measures, 
because it corresponds so closely to an important real-world 
resource: the amount of physical computer 
memory needed to run a given program.
Algorithm Strategies 
 Greedy 
 Divide and Conquer 
 Dynamic Programming
Which Data Structure or 
Algorithm is better? 
 Must Meet Requirement 
 High Performance 
 Low RAM footprint 
 Easy to implement 
 Encapsulated
Pointer Variable 
 A pointer variable is a variable that contains the memory 
location of another variable or an array (or anything else in 
memory). 
 Effectively, it points to another memory location. 
 For standard variables, you define a type, assign a value to 
that variable or read the value from it, and you can also read 
the memory location (&n = memory location of n) of the 
variable. 
 For pointers, you can point them to any variable, even another 
pointer, and you can get the value of the variable it points to 
(*p), the location of that variable in memory (p), or the address 
in memory of the pointer itself (&p).
Pointer Variable[Cont…] 
 Pointers are declared with the use of the asterisk ( *). In 
the example 
int *foo; 
float *bar; 
 Here, foo is declared as a pointer to an integer, and bar is 
declared as a pointer to a floating point number.
Pointer Variable[Cont…] 
 To make a pointer variable point at some other variable, 
the ampersand operator is used. The ampersand operator 
returns the address of a variable's value; that is, the place 
in memory where the variable's value is stored. Thus: 
int *foo; 
int x= 5; 
foo= &x; 
 It makes the pointer foo ``point at'' the value of x (which 
happens to be 5).
Pointer Variable[Cont…] 
 This pointer can now be used to retrieve the value 
of x using the asterisk operator. This process is called de-referencing. 
The pointer, or reference to a value, is used to 
fetch the value being pointed at. Thus: 
int y; 
y= *foo; 
 It sets y equal to the value pointed at by foo. In the 
previous example, foo was set to point at x, which had the 
value 5. Thus, the result of dereferencing foo yields 5, 
and y will be set to 5.
THANK YOU….. !!!

Weitere ähnliche Inhalte

Was ist angesagt?

Data structure and algorithm All in One
Data structure and algorithm All in OneData structure and algorithm All in One
Data structure and algorithm All in Onejehan1987
 
Sorting in python
Sorting in python Sorting in python
Sorting in python Simplilearn
 
Algorithm analysis
Algorithm analysisAlgorithm analysis
Algorithm analysissumitbardhan
 
Binary search in data structure
Binary search in data structureBinary search in data structure
Binary search in data structureMeherul1234
 
Hashing Technique In Data Structures
Hashing Technique In Data StructuresHashing Technique In Data Structures
Hashing Technique In Data StructuresSHAKOOR AB
 
Bruteforce algorithm
Bruteforce algorithmBruteforce algorithm
Bruteforce algorithmRezwan Siam
 
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
 
Lecture 4 asymptotic notations
Lecture 4   asymptotic notationsLecture 4   asymptotic notations
Lecture 4 asymptotic notationsjayavignesh86
 
Performance analysis and randamized agoritham
Performance analysis and randamized agorithamPerformance analysis and randamized agoritham
Performance analysis and randamized agorithamlilyMalar1
 
Python Programming - XI. String Manipulation and Regular Expressions
Python Programming - XI. String Manipulation and Regular ExpressionsPython Programming - XI. String Manipulation and Regular Expressions
Python Programming - XI. String Manipulation and Regular ExpressionsRanel Padon
 
Data Structure: Algorithm and analysis
Data Structure: Algorithm and analysisData Structure: Algorithm and analysis
Data Structure: Algorithm and analysisDr. Rajdeep Chatterjee
 
Data structure lecture 1
Data structure lecture 1Data structure lecture 1
Data structure lecture 1Kumar
 

Was ist angesagt? (20)

Data structure and algorithm All in One
Data structure and algorithm All in OneData structure and algorithm All in One
Data structure and algorithm All in One
 
Sorting in python
Sorting in python Sorting in python
Sorting in python
 
Data Structure and Algorithms
Data Structure and AlgorithmsData Structure and Algorithms
Data Structure and Algorithms
 
Algorithm analysis
Algorithm analysisAlgorithm analysis
Algorithm analysis
 
Binary search in data structure
Binary search in data structureBinary search in data structure
Binary search in data structure
 
Daa notes 1
Daa notes 1Daa notes 1
Daa notes 1
 
Hashing Technique In Data Structures
Hashing Technique In Data StructuresHashing Technique In Data Structures
Hashing Technique In Data Structures
 
Bruteforce algorithm
Bruteforce algorithmBruteforce algorithm
Bruteforce algorithm
 
Complexity of Algorithm
Complexity of AlgorithmComplexity of Algorithm
Complexity of Algorithm
 
Time complexity.ppt
Time complexity.pptTime complexity.ppt
Time complexity.ppt
 
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
 
Sorting algorithms
Sorting algorithmsSorting algorithms
Sorting algorithms
 
Analysis of algorithm
Analysis of algorithmAnalysis of algorithm
Analysis of algorithm
 
Lecture 4 asymptotic notations
Lecture 4   asymptotic notationsLecture 4   asymptotic notations
Lecture 4 asymptotic notations
 
Performance analysis and randamized agoritham
Performance analysis and randamized agorithamPerformance analysis and randamized agoritham
Performance analysis and randamized agoritham
 
Python Programming - XI. String Manipulation and Regular Expressions
Python Programming - XI. String Manipulation and Regular ExpressionsPython Programming - XI. String Manipulation and Regular Expressions
Python Programming - XI. String Manipulation and Regular Expressions
 
Data Structure: Algorithm and analysis
Data Structure: Algorithm and analysisData Structure: Algorithm and analysis
Data Structure: Algorithm and analysis
 
Data structure lecture 1
Data structure lecture 1Data structure lecture 1
Data structure lecture 1
 
Complexity analysis in Algorithms
Complexity analysis in AlgorithmsComplexity analysis in Algorithms
Complexity analysis in Algorithms
 
Asymptotic Notation
Asymptotic NotationAsymptotic Notation
Asymptotic Notation
 

Andere mochten auch

Security Compensation - How to Invest in Start-Up Security
Security Compensation - How to Invest in Start-Up SecuritySecurity Compensation - How to Invest in Start-Up Security
Security Compensation - How to Invest in Start-Up SecurityChristopher Grayson
 
AP Computer Science Test Prep - Part 3 - Data Structure & Algorithm
AP Computer Science Test Prep - Part 3 - Data Structure & AlgorithmAP Computer Science Test Prep - Part 3 - Data Structure & Algorithm
AP Computer Science Test Prep - Part 3 - Data Structure & AlgorithmNR Computer Learning Center
 
Meaningful Elearning with Digital Badges & Missions
Meaningful Elearning with Digital Badges & MissionsMeaningful Elearning with Digital Badges & Missions
Meaningful Elearning with Digital Badges & MissionsShelly Sanchez Terrell
 
Introduction to datastructure and algorithm
Introduction to datastructure and algorithmIntroduction to datastructure and algorithm
Introduction to datastructure and algorithmPratik Mota
 
Computer Science Engineering : Data structure & algorithm, THE GATE ACADEMY
Computer Science Engineering : Data structure & algorithm, THE GATE ACADEMYComputer Science Engineering : Data structure & algorithm, THE GATE ACADEMY
Computer Science Engineering : Data structure & algorithm, THE GATE ACADEMYklirantga
 
Data structure and algorithm.(dsa)
Data structure and algorithm.(dsa)Data structure and algorithm.(dsa)
Data structure and algorithm.(dsa)mailmerk
 
17 online learning resources and websites you should check out
17 online learning resources and websites you should check out17 online learning resources and websites you should check out
17 online learning resources and websites you should check outTiffany St James
 
10 Principles of English Teaching (SLA Research)
10 Principles of English Teaching (SLA Research)10 Principles of English Teaching (SLA Research)
10 Principles of English Teaching (SLA Research)Phung Huy
 
12 Hacks That Will Improve Your Studying
 12 Hacks That Will Improve Your Studying 12 Hacks That Will Improve Your Studying
12 Hacks That Will Improve Your StudyingKaplan
 
The 8 C's of Learning Starting with Citizenship
The 8 C's of Learning Starting with Citizenship The 8 C's of Learning Starting with Citizenship
The 8 C's of Learning Starting with Citizenship Shelly Sanchez Terrell
 
16 Maxims of Skillful Teaching
16 Maxims of Skillful Teaching16 Maxims of Skillful Teaching
16 Maxims of Skillful TeachingWiley
 
មេរៀនៈ 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
 
How to Pack a Punch With Social Media
How to Pack a Punch With Social MediaHow to Pack a Punch With Social Media
How to Pack a Punch With Social MediaGuy Kawasaki
 
If I Knew Then What I Know Now/Skills That I Think Students Should Have/What ...
If I Knew Then What I Know Now/Skills That I Think Students Should Have/What ...If I Knew Then What I Know Now/Skills That I Think Students Should Have/What ...
If I Knew Then What I Know Now/Skills That I Think Students Should Have/What ...Guy Kawasaki
 
Leadership in the Digital Age
Leadership in the Digital AgeLeadership in the Digital Age
Leadership in the Digital AgeAngela Maiers
 
What I learned teaching programming to 150 beginners
What I learned teaching programming to 150 beginnersWhat I learned teaching programming to 150 beginners
What I learned teaching programming to 150 beginnersEtiene Dalcol
 

Andere mochten auch (16)

Security Compensation - How to Invest in Start-Up Security
Security Compensation - How to Invest in Start-Up SecuritySecurity Compensation - How to Invest in Start-Up Security
Security Compensation - How to Invest in Start-Up Security
 
AP Computer Science Test Prep - Part 3 - Data Structure & Algorithm
AP Computer Science Test Prep - Part 3 - Data Structure & AlgorithmAP Computer Science Test Prep - Part 3 - Data Structure & Algorithm
AP Computer Science Test Prep - Part 3 - Data Structure & Algorithm
 
Meaningful Elearning with Digital Badges & Missions
Meaningful Elearning with Digital Badges & MissionsMeaningful Elearning with Digital Badges & Missions
Meaningful Elearning with Digital Badges & Missions
 
Introduction to datastructure and algorithm
Introduction to datastructure and algorithmIntroduction to datastructure and algorithm
Introduction to datastructure and algorithm
 
Computer Science Engineering : Data structure & algorithm, THE GATE ACADEMY
Computer Science Engineering : Data structure & algorithm, THE GATE ACADEMYComputer Science Engineering : Data structure & algorithm, THE GATE ACADEMY
Computer Science Engineering : Data structure & algorithm, THE GATE ACADEMY
 
Data structure and algorithm.(dsa)
Data structure and algorithm.(dsa)Data structure and algorithm.(dsa)
Data structure and algorithm.(dsa)
 
17 online learning resources and websites you should check out
17 online learning resources and websites you should check out17 online learning resources and websites you should check out
17 online learning resources and websites you should check out
 
10 Principles of English Teaching (SLA Research)
10 Principles of English Teaching (SLA Research)10 Principles of English Teaching (SLA Research)
10 Principles of English Teaching (SLA Research)
 
12 Hacks That Will Improve Your Studying
 12 Hacks That Will Improve Your Studying 12 Hacks That Will Improve Your Studying
12 Hacks That Will Improve Your Studying
 
The 8 C's of Learning Starting with Citizenship
The 8 C's of Learning Starting with Citizenship The 8 C's of Learning Starting with Citizenship
The 8 C's of Learning Starting with Citizenship
 
16 Maxims of Skillful Teaching
16 Maxims of Skillful Teaching16 Maxims of Skillful Teaching
16 Maxims of Skillful Teaching
 
មេរៀនៈ 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++
 
How to Pack a Punch With Social Media
How to Pack a Punch With Social MediaHow to Pack a Punch With Social Media
How to Pack a Punch With Social Media
 
If I Knew Then What I Know Now/Skills That I Think Students Should Have/What ...
If I Knew Then What I Know Now/Skills That I Think Students Should Have/What ...If I Knew Then What I Know Now/Skills That I Think Students Should Have/What ...
If I Knew Then What I Know Now/Skills That I Think Students Should Have/What ...
 
Leadership in the Digital Age
Leadership in the Digital AgeLeadership in the Digital Age
Leadership in the Digital Age
 
What I learned teaching programming to 150 beginners
What I learned teaching programming to 150 beginnersWhat I learned teaching programming to 150 beginners
What I learned teaching programming to 150 beginners
 

Ähnlich wie Data structure and algorithm

VCE Unit 01 (2).pptx
VCE Unit 01 (2).pptxVCE Unit 01 (2).pptx
VCE Unit 01 (2).pptxskilljiolms
 
Chapter 2.2 data structures
Chapter 2.2 data structuresChapter 2.2 data structures
Chapter 2.2 data structuressshhzap
 
Unit i basic concepts of algorithms
Unit i basic concepts of algorithmsUnit i basic concepts of algorithms
Unit i basic concepts of algorithmssangeetha s
 
Algorithm Complexity and Main Concepts
Algorithm Complexity and Main ConceptsAlgorithm Complexity and Main Concepts
Algorithm Complexity and Main ConceptsAdelina Ahadova
 
Introduction to data structures and Algorithm
Introduction to data structures and AlgorithmIntroduction to data structures and Algorithm
Introduction to data structures and AlgorithmDhaval Kaneria
 
Cupdf.com introduction to-data-structures-and-algorithm
Cupdf.com introduction to-data-structures-and-algorithmCupdf.com introduction to-data-structures-and-algorithm
Cupdf.com introduction to-data-structures-and-algorithmTarikuDabala1
 
Introduction to data structures and Algorithm
Introduction to data structures and AlgorithmIntroduction to data structures and Algorithm
Introduction to data structures and AlgorithmDhaval Kaneria
 
Aad introduction
Aad introductionAad introduction
Aad introductionMr SMAK
 
FALLSEM2022-23_BCSE202L_TH_VL2022230103292_Reference_Material_I_25-07-2022_Fu...
FALLSEM2022-23_BCSE202L_TH_VL2022230103292_Reference_Material_I_25-07-2022_Fu...FALLSEM2022-23_BCSE202L_TH_VL2022230103292_Reference_Material_I_25-07-2022_Fu...
FALLSEM2022-23_BCSE202L_TH_VL2022230103292_Reference_Material_I_25-07-2022_Fu...AntareepMajumder
 
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.pptxline24arts
 
Module 1 notes of data warehousing and data
Module 1 notes of data warehousing and dataModule 1 notes of data warehousing and data
Module 1 notes of data warehousing and datavijipersonal2012
 
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.pptxesuEthopi
 
Programming in C sesion 2
Programming in C sesion 2Programming in C sesion 2
Programming in C sesion 2Prerna Sharma
 
Introduction to Data Structures Sorting and searching
Introduction to Data Structures Sorting and searchingIntroduction to Data Structures Sorting and searching
Introduction to Data Structures Sorting and searchingMvenkatarao
 

Ähnlich wie Data structure and algorithm (20)

Unit ii algorithm
Unit   ii algorithmUnit   ii algorithm
Unit ii algorithm
 
VCE Unit 01 (2).pptx
VCE Unit 01 (2).pptxVCE Unit 01 (2).pptx
VCE Unit 01 (2).pptx
 
Chapter 2.2 data structures
Chapter 2.2 data structuresChapter 2.2 data structures
Chapter 2.2 data structures
 
Unit i basic concepts of algorithms
Unit i basic concepts of algorithmsUnit i basic concepts of algorithms
Unit i basic concepts of algorithms
 
Algorithm Complexity and Main Concepts
Algorithm Complexity and Main ConceptsAlgorithm Complexity and Main Concepts
Algorithm Complexity and Main Concepts
 
Introduction to algorithms
Introduction to algorithmsIntroduction to algorithms
Introduction to algorithms
 
Lect1.pptx
Lect1.pptxLect1.pptx
Lect1.pptx
 
Introduction to data structures and Algorithm
Introduction to data structures and AlgorithmIntroduction to data structures and Algorithm
Introduction to data structures and Algorithm
 
Cupdf.com introduction to-data-structures-and-algorithm
Cupdf.com introduction to-data-structures-and-algorithmCupdf.com introduction to-data-structures-and-algorithm
Cupdf.com introduction to-data-structures-and-algorithm
 
Introduction to data structures and Algorithm
Introduction to data structures and AlgorithmIntroduction to data structures and Algorithm
Introduction to data structures and Algorithm
 
Aad introduction
Aad introductionAad introduction
Aad introduction
 
Algorithm.pptx
Algorithm.pptxAlgorithm.pptx
Algorithm.pptx
 
Algorithm.pptx
Algorithm.pptxAlgorithm.pptx
Algorithm.pptx
 
FALLSEM2022-23_BCSE202L_TH_VL2022230103292_Reference_Material_I_25-07-2022_Fu...
FALLSEM2022-23_BCSE202L_TH_VL2022230103292_Reference_Material_I_25-07-2022_Fu...FALLSEM2022-23_BCSE202L_TH_VL2022230103292_Reference_Material_I_25-07-2022_Fu...
FALLSEM2022-23_BCSE202L_TH_VL2022230103292_Reference_Material_I_25-07-2022_Fu...
 
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
 
Module 1 notes of data warehousing and data
Module 1 notes of data warehousing and dataModule 1 notes of data warehousing and data
Module 1 notes of data warehousing and data
 
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
 
Ds
DsDs
Ds
 
Programming in C sesion 2
Programming in C sesion 2Programming in C sesion 2
Programming in C sesion 2
 
Introduction to Data Structures Sorting and searching
Introduction to Data Structures Sorting and searchingIntroduction to Data Structures Sorting and searching
Introduction to Data Structures Sorting and searching
 

Mehr von Trupti Agrawal

Mehr von Trupti Agrawal (6)

Trees (data structure)
Trees (data structure)Trees (data structure)
Trees (data structure)
 
Searching algorithms
Searching algorithmsSearching algorithms
Searching algorithms
 
Searching algorithms
Searching algorithmsSearching algorithms
Searching algorithms
 
Linked list
Linked listLinked list
Linked list
 
Stacks and queues
Stacks and queuesStacks and queues
Stacks and queues
 
Arrays
ArraysArrays
Arrays
 

Kürzlich hochgeladen

DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 

Kürzlich hochgeladen (20)

DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 

Data structure and algorithm

  • 1. What is Program  A Set of Instructions  Data Structures + Algorithms  Data Structure = A Container stores Data  Algorithm = Logic + Control Trupti Agrawal 1
  • 2. DATA STRUCTURE  A data structure is a particular way of organizing data in a computer so that it can be used efficiently.  Different kinds of data structures are suited to different kinds of applications, and some are highly specialized to specific tasks. For example, B-trees are particularly well-suited for implementation of databases, while compiler implementations usually use hash table to look up identifiers.  Data structures provide a means to manage large amounts of data efficiently, such as large databases and internet indexing services.  Usually, efficient data structures are a key in designing efficient algorithms.  Some formal design methods and programming languages emphasize data structures, rather than algorithms, as the key organizing factor in software design. Storing and retrieving can be carried out on data stored in both main memory and in secondary memory.
  • 3. Common Data Structures  Array  Stack  Queue  Linked List  Tree  Heap  Hash Table  Priority Queue
  • 4. Introduction to Algorithm  An algorithm is a finite set of instructions that accomplishes a particular task.  Criteria  input: zero or more quantities that are externally supplied  output: at least one quantity is produced  definiteness: clear and unambiguous  finiteness: terminate after a finite number of steps  effectiveness: instruction is basic enough to be carried out  A program does not have to satisfy the finiteness criteria
  • 5. [Cont…]  Representation  A natural language, like English or Chinese.  A graphic, like flowcharts.  A computer language, like C.  Algorithms + Data structures = Programs [NiklusWirth]
  • 6. Designing an Algorithm  Requirements  Analysis: bottom-up vs. top-down  Design: data objects and operations  Refinement and Coding  Verification  Program Proving  Testing  Debugging
  • 8. Analysis of algorithms  In computer science, the analysis of algorithms is the determination of the number of resources (such as time and storage) necessary to execute them.  Most algorithms are designed to work with inputs of arbitrary length. Usually the efficiency or running time of an algorithm is stated as a function relating the input length to the number of steps (time complexity) or storage locations (space complexity).  Algorithm analysis is an important part of a broader computational complexity theory, which provides theoretical estimates for the resources needed by any algorithm which solves a given computational problem. These estimates provide an insight into reasonable directions of search for efficient algorithms.
  • 9. Time complexity  In computer science, the time complexity of an algorithm quantifies the amount of time taken by an algorithm to run as a function of the length of the string representing the input. The time complexity of an algorithm is commonly expressed using big O notation, which excludes coefficients and lower order terms. When expressed this way, the time complexity is said to be described asymptotically, i.e., as the input size goes to infinity. For example, if the time required by an algorithm on all inputs of size n is at most 5n3 + 3n, the asymptotic time complexity is O(n3).
  • 10. [Cont…]  Since an algorithm's performance time may vary with different inputs of the same size, one commonly uses the worst-case time complexity of an algorithm, denoted as T(n), which is defined as the maximum amount of time taken on any input of size n. Time complexities are classified by the nature of the function T(n). For instance, an algorithm with T(n) = O(n) is called a linear time algorithm, and an algorithm with T(n) = O(2n) is said to be an exponential time algorithm.
  • 11. Space complexity  It represents the total amount of memory space that a "normal" physical computer would need to solve a given computational problem with a given algorithm. It is one of the most well-studied complexity measures, because it corresponds so closely to an important real-world resource: the amount of physical computer memory needed to run a given program.
  • 12. Algorithm Strategies  Greedy  Divide and Conquer  Dynamic Programming
  • 13. Which Data Structure or Algorithm is better?  Must Meet Requirement  High Performance  Low RAM footprint  Easy to implement  Encapsulated
  • 14. Pointer Variable  A pointer variable is a variable that contains the memory location of another variable or an array (or anything else in memory).  Effectively, it points to another memory location.  For standard variables, you define a type, assign a value to that variable or read the value from it, and you can also read the memory location (&n = memory location of n) of the variable.  For pointers, you can point them to any variable, even another pointer, and you can get the value of the variable it points to (*p), the location of that variable in memory (p), or the address in memory of the pointer itself (&p).
  • 15. Pointer Variable[Cont…]  Pointers are declared with the use of the asterisk ( *). In the example int *foo; float *bar;  Here, foo is declared as a pointer to an integer, and bar is declared as a pointer to a floating point number.
  • 16. Pointer Variable[Cont…]  To make a pointer variable point at some other variable, the ampersand operator is used. The ampersand operator returns the address of a variable's value; that is, the place in memory where the variable's value is stored. Thus: int *foo; int x= 5; foo= &x;  It makes the pointer foo ``point at'' the value of x (which happens to be 5).
  • 17. Pointer Variable[Cont…]  This pointer can now be used to retrieve the value of x using the asterisk operator. This process is called de-referencing. The pointer, or reference to a value, is used to fetch the value being pointed at. Thus: int y; y= *foo;  It sets y equal to the value pointed at by foo. In the previous example, foo was set to point at x, which had the value 5. Thus, the result of dereferencing foo yields 5, and y will be set to 5.