SlideShare uma empresa Scribd logo
1 de 16
Introduction to DS
                   Definition
 An algorithm is a finite sequence of instructions
  each of which has a clear meaning and can be
  performed with a finite amount of effort in a finite
  length of time.




28 May 2012             Software Tools
                                                         1
Structure of Algorithms
 Input step
 Assignment step
 Decision step
 Repetitive step
 Output step




28 May 2012            Software Tools
                                        2
Properties of Algorithm
 Finiteness
   • An algorithm must terminate after a finite number of steps.
 Definiteness
   • Steps must be precisely defined.
   • No ambiguity in steps.
 Generality
   • It must be generic enough to solve all problem of same class
 Effectiveness
   • The steps of operations must be basic
   • Not too much complex
 Input-Output
   • It must have initial and precise inputs.
   • Output may be generated both at intermediate and final steps.
Data Structure and Algorithms
 Data Structure
   • A data structure is a way of organizing data that
     considers not only the items stored, but also their
     relationship to each other.
 The design of an efficient algorithm for the solution
  of the problem needs the use of appropriate data
  structure.
 The program which satisfy all the properties of
  algorithm is not enough for efficient
  implementation of algorithm.
Cont…
 It is important to arrange the data in well
  structured manner to prepare efficient algorithm.
 Thus, for the design of efficient solution of a
  problem, it is essential that algorithm goes hand in
  hand with appropriate data structure.




28 May 2012             Software Tools
                                                         5
Efficiency of Algorithm
 One problem can be solved in many ways then to
  choose the best one among them we required to
  measure the performance of algorithm.
 The performance of algorithm can be measured by
  two main parameter:
  • Time
  • Space
Efficiency of Algorithm (Cont…)
 Empirical or posterior testing approach
   • Implement the complete algorithms and execute them
     for various instances of the problems.
   • The time taken for execution of the programs is noted.
   • Algorithm taking less time is considered as the best
     among all.
   • Its disadvantage is that it depend on various factors like –
         machine on which it is executed.
Efficiency of Algorithm (Cont…)
         Programming language with which it is implemented
         Skills of a programmer
 Theoretical or apriori approach
   • Mathematically determine the resources such as time
     and space needed by algorithm in form of a function of a
     parameter related to the instance of the problem
     considered.
   • This approach is entirely machine, language and program
     independent.
   • It allows to study the efficiency of the algorithm on any
     input size instance.
Asymptotic Notation
 Apriori analysis uses asymptotic notations to
  express the time complexity of algorithms.
 Asymptotic notations are meaningful
  approximations of functions that represent the
  time and space complexity of a program.
Asymptotic Notation (Cont…)
 Big O notation
      • f(n)=O(g(n)) (read: f of n is big oh of g of n), if there exists
        a positive integer n0 and a positive number c such that
        |f(n)|≤c|g(n)|, for all n≥n0.
      • It shows upper bound of a function.



                   f(n)                g(n)
               16n3+12n2+12n            n3        f(n) = O(n3)
                 34n – 90                n        f(n) = O(n)
                    56                   1        f(n) = O(1)



28 May 2012                      Software Tools
                                                                           10
Asymptotic Notation (Cont…)
 Omega notation
  • f(n)=Ω(g(n))(read: f of n is omega of g of n), if there exists
    a positive integer n0 and a positive integer c such that
    |f(n)|≥c|g(n)|, for all n≥n0.
  • Here g(n) indicate the lower bound of the function f(n).



              f(n)             g(n)
         16n3+12n2+12n          n3         f(n) = Ω(n3)
            34n – 90            n          f(n) = Ω(n)
              56                1          f(n) = Ω(1)
Asymptotic Notation (Cont…)
 Thita notation
   • f(n)= Ө(g(n))(read: f of n is thita of g of n), if there exists
     a positive integer n0 and a positive integer c1 and c2 such
     that
      c1|g(n)| ≤ |f(n)| ≤c2|g(n)|, for all n≥n0.
   • Here g(n) indicate the upper bound as well as lower
     bound of the function f(n).
               f(n)              g(n)
          16n3+12n2+12n           n3         f(n) = Ө(n3)
             34n – 90             n           f(n) = Ө(n)
                56                1           f(n) = Ө(1)
Asymptotic Notation (Cont…)
 Little oh notation
   • f(n)=o(g(n)) (read: f of n is little oh of g of n) if
     f(n)=O(g(n)) and f(n) ≠ Ω(g(n)).


               f(n)              g(n)
             18n3 + 9             n3         f(n) = o(n3) because
                                            f(n) = O(n3) and f(n) ≠
                                                     Ω(n3)
Average, Best and Worst Cases
 The time complexity of an algorithm is dependent
  on parameters associated with the input/output
  instances of the problem.
 Many times the input size is only used to calculate
  the complexity, in such cases if input size is larger
  then execution time will be larger.
 But all the time it is not appropriate to consider
  only the size of input for calculating complexity.




28 May 2012               Software Tools
                                                          14
Cont…
 Sometimes, the complexity is also depends on the
  nature of input.
 For example, consider the following data for
  sequentially searching the first even number in the
  list.

                                    Input data                             Case
              -1, 3, 5, 7, -5, 11, -13, 17, 71, 9, 3, 1, -23, 39, 7, 40   Worst
              6, 11, 25, 5, -5, 6, 23, -2, 26, 71, 9, 3, 1, -23, 39, 7     Best
              -1, 3, 11, 5, 7, -5, -13, 16, 11, 25, 5, -5, 6, 23, -2, 7   Average




28 May 2012                                  Software Tools
                                                                                    15
 Worst case:
   • The input instance for which algorithm takes the maximum
     possible time is called the worst case.
   • The time complexity in such a case is called worst case time
     complexity.
 Best case:
   • The input instance for which algorithm takes the minimum
     possible time is called the best case.
   • The time complexity in such a case is called best case time
     complexity.

 Average case:
   • All input instances which are neither of a best case nor of a
     worst case are categorized as average case.
   • The time complexity of the algorithm in such cases is referred
     to as the average case complexity.

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

02 order of growth
02 order of growth02 order of growth
02 order of growth
 
Daa chapter 1
Daa chapter 1Daa chapter 1
Daa chapter 1
 
Daa unit 1
Daa unit 1Daa unit 1
Daa unit 1
 
Dynamic programming
Dynamic programmingDynamic programming
Dynamic programming
 
Analysis and Algorithms: basic Introduction
Analysis and Algorithms: basic IntroductionAnalysis and Algorithms: basic Introduction
Analysis and Algorithms: basic Introduction
 
Design and Analysis of Algorithms
Design and Analysis of AlgorithmsDesign and Analysis of Algorithms
Design and Analysis of Algorithms
 
Introduction to design and analysis of algorithm
Introduction to design and analysis of algorithmIntroduction to design and analysis of algorithm
Introduction to design and analysis of algorithm
 
Analysis of Algorithm
Analysis of AlgorithmAnalysis of Algorithm
Analysis of Algorithm
 
Lecture 8 dynamic programming
Lecture 8 dynamic programmingLecture 8 dynamic programming
Lecture 8 dynamic programming
 
dynamic programming complete by Mumtaz Ali (03154103173)
dynamic programming complete by Mumtaz Ali (03154103173)dynamic programming complete by Mumtaz Ali (03154103173)
dynamic programming complete by Mumtaz Ali (03154103173)
 
Kk20503 1 introduction
Kk20503 1 introductionKk20503 1 introduction
Kk20503 1 introduction
 
Code Optimization
Code OptimizationCode Optimization
Code Optimization
 
Dynamic Programming
Dynamic ProgrammingDynamic Programming
Dynamic Programming
 
Algorithm Introduction
Algorithm IntroductionAlgorithm Introduction
Algorithm Introduction
 
Code optimization
Code optimization Code optimization
Code optimization
 
Dynamicpgmming
DynamicpgmmingDynamicpgmming
Dynamicpgmming
 
Algorithm
AlgorithmAlgorithm
Algorithm
 
Algorithm
AlgorithmAlgorithm
Algorithm
 
Unit 7 dynamic programming
Unit 7   dynamic programmingUnit 7   dynamic programming
Unit 7 dynamic programming
 
Daa notes 1
Daa notes 1Daa notes 1
Daa notes 1
 

Destaque

Phd defense - Linked data based exploratory search - Nicolas MARIE
Phd defense - Linked data based exploratory search - Nicolas MARIEPhd defense - Linked data based exploratory search - Nicolas MARIE
Phd defense - Linked data based exploratory search - Nicolas MARIENicolas MARIE
 
Database Schema Evolution
Database Schema EvolutionDatabase Schema Evolution
Database Schema EvolutionLars Thorup
 
Operating system
Operating systemOperating system
Operating systemLovly Angel
 
GPRS Technology
GPRS TechnologyGPRS Technology
GPRS TechnologyMadhu Bala
 
Algorithm analysis (All in one)
Algorithm analysis (All in one)Algorithm analysis (All in one)
Algorithm analysis (All in one)jehan1987
 
Design and Analysis of Algorithms
Design and Analysis of AlgorithmsDesign and Analysis of Algorithms
Design and Analysis of AlgorithmsArvind Krishnaa
 
DESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMSDESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMSGayathri Gaayu
 
Network topology
Network topologyNetwork topology
Network topologylekshmik
 
Algorithm - Introduction
Algorithm - IntroductionAlgorithm - Introduction
Algorithm - IntroductionMadhu Bala
 

Destaque (15)

Phd defense - Linked data based exploratory search - Nicolas MARIE
Phd defense - Linked data based exploratory search - Nicolas MARIEPhd defense - Linked data based exploratory search - Nicolas MARIE
Phd defense - Linked data based exploratory search - Nicolas MARIE
 
Prevemont en Castilla y León Económica
Prevemont en Castilla y León EconómicaPrevemont en Castilla y León Económica
Prevemont en Castilla y León Económica
 
Database Schema Evolution
Database Schema EvolutionDatabase Schema Evolution
Database Schema Evolution
 
Dsa & Digi Cert
Dsa & Digi CertDsa & Digi Cert
Dsa & Digi Cert
 
Algorithm Class at KPHB (C, C++ Course Training Institute in KPHB, Kukatpally...
Algorithm Class at KPHB (C, C++ Course Training Institute in KPHB, Kukatpally...Algorithm Class at KPHB (C, C++ Course Training Institute in KPHB, Kukatpally...
Algorithm Class at KPHB (C, C++ Course Training Institute in KPHB, Kukatpally...
 
Operating system
Operating systemOperating system
Operating system
 
Design & Analysis Of Algorithm
Design & Analysis Of AlgorithmDesign & Analysis Of Algorithm
Design & Analysis Of Algorithm
 
Chapter02
Chapter02Chapter02
Chapter02
 
GPRS Technology
GPRS TechnologyGPRS Technology
GPRS Technology
 
Algorithm analysis (All in one)
Algorithm analysis (All in one)Algorithm analysis (All in one)
Algorithm analysis (All in one)
 
Design and Analysis of Algorithms
Design and Analysis of AlgorithmsDesign and Analysis of Algorithms
Design and Analysis of Algorithms
 
DESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMSDESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMS
 
Dbms architecture
Dbms architectureDbms architecture
Dbms architecture
 
Network topology
Network topologyNetwork topology
Network topology
 
Algorithm - Introduction
Algorithm - IntroductionAlgorithm - Introduction
Algorithm - Introduction
 

Semelhante a Unit 1

DAA-Unit1.pptx
DAA-Unit1.pptxDAA-Unit1.pptx
DAA-Unit1.pptxNishaS88
 
Algorithm Analysis.pdf
Algorithm Analysis.pdfAlgorithm Analysis.pdf
Algorithm Analysis.pdfMemMem25
 
CS8451 - Design and Analysis of Algorithms
CS8451 - Design and Analysis of AlgorithmsCS8451 - Design and Analysis of Algorithms
CS8451 - Design and Analysis of AlgorithmsKrishnan MuthuManickam
 
Asymptotic Notations
Asymptotic NotationsAsymptotic Notations
Asymptotic NotationsRishabh Soni
 
asymptotic analysis and insertion sort analysis
asymptotic analysis and insertion sort analysisasymptotic analysis and insertion sort analysis
asymptotic analysis and insertion sort analysisAnindita Kundu
 
Data Structures- Part2 analysis tools
Data Structures- Part2 analysis toolsData Structures- Part2 analysis tools
Data Structures- Part2 analysis toolsAbdullah Al-hazmy
 
Data Structures and Algorithms - Lec 02.pdf
Data Structures and Algorithms - Lec 02.pdfData Structures and Algorithms - Lec 02.pdf
Data Structures and Algorithms - Lec 02.pdfRameshaFernando2
 
Algorithms & Complexity Calculation
Algorithms & Complexity CalculationAlgorithms & Complexity Calculation
Algorithms & Complexity CalculationAkhil Kaushik
 
Asymptotics 140510003721-phpapp02
Asymptotics 140510003721-phpapp02Asymptotics 140510003721-phpapp02
Asymptotics 140510003721-phpapp02mansab MIRZA
 
Analysis of algorithms
Analysis of algorithmsAnalysis of algorithms
Analysis of algorithmsAsen Bozhilov
 
Asymptotic Notations.pptx
Asymptotic Notations.pptxAsymptotic Notations.pptx
Asymptotic Notations.pptxSunilWork1
 
Data Structure & Algorithms - Mathematical
Data Structure & Algorithms - MathematicalData Structure & Algorithms - Mathematical
Data Structure & Algorithms - Mathematicalbabuk110
 
Daa unit 6_efficiency of algorithms
Daa unit 6_efficiency of algorithmsDaa unit 6_efficiency of algorithms
Daa unit 6_efficiency of algorithmssnehajiyani
 
Data structures notes for college students btech.pptx
Data structures notes for college students btech.pptxData structures notes for college students btech.pptx
Data structures notes for college students btech.pptxKarthikVijay59
 

Semelhante a Unit 1 (20)

DAA-Unit1.pptx
DAA-Unit1.pptxDAA-Unit1.pptx
DAA-Unit1.pptx
 
Unit ii algorithm
Unit   ii algorithmUnit   ii algorithm
Unit ii algorithm
 
Algorithm Analysis.pdf
Algorithm Analysis.pdfAlgorithm Analysis.pdf
Algorithm Analysis.pdf
 
CS8451 - Design and Analysis of Algorithms
CS8451 - Design and Analysis of AlgorithmsCS8451 - Design and Analysis of Algorithms
CS8451 - Design and Analysis of Algorithms
 
Asymptotic Notations
Asymptotic NotationsAsymptotic Notations
Asymptotic Notations
 
asymptotic analysis and insertion sort analysis
asymptotic analysis and insertion sort analysisasymptotic analysis and insertion sort analysis
asymptotic analysis and insertion sort analysis
 
Data Structures- Part2 analysis tools
Data Structures- Part2 analysis toolsData Structures- Part2 analysis tools
Data Structures- Part2 analysis tools
 
Data Structures and Algorithms - Lec 02.pdf
Data Structures and Algorithms - Lec 02.pdfData Structures and Algorithms - Lec 02.pdf
Data Structures and Algorithms - Lec 02.pdf
 
Algorithms & Complexity Calculation
Algorithms & Complexity CalculationAlgorithms & Complexity Calculation
Algorithms & Complexity Calculation
 
Asymptotics 140510003721-phpapp02
Asymptotics 140510003721-phpapp02Asymptotics 140510003721-phpapp02
Asymptotics 140510003721-phpapp02
 
Lec1
Lec1Lec1
Lec1
 
Analysis of algorithms
Analysis of algorithmsAnalysis of algorithms
Analysis of algorithms
 
Algorithm Class at KPHB (C, C++ Course Training Institute in KPHB, Kukatpally...
Algorithm Class at KPHB (C, C++ Course Training Institute in KPHB, Kukatpally...Algorithm Class at KPHB (C, C++ Course Training Institute in KPHB, Kukatpally...
Algorithm Class at KPHB (C, C++ Course Training Institute in KPHB, Kukatpally...
 
Algorithm Class at KPHB (C, C++ Course Training Institute in KPHB, Kukatpally...
Algorithm Class at KPHB (C, C++ Course Training Institute in KPHB, Kukatpally...Algorithm Class at KPHB (C, C++ Course Training Institute in KPHB, Kukatpally...
Algorithm Class at KPHB (C, C++ Course Training Institute in KPHB, Kukatpally...
 
Algorithm Class at KPHB (C, C++ Course Training Institute in KPHB, Kukatpall...
Algorithm Class at KPHB  (C, C++ Course Training Institute in KPHB, Kukatpall...Algorithm Class at KPHB  (C, C++ Course Training Institute in KPHB, Kukatpall...
Algorithm Class at KPHB (C, C++ Course Training Institute in KPHB, Kukatpall...
 
Algorithms
Algorithms Algorithms
Algorithms
 
Asymptotic Notations.pptx
Asymptotic Notations.pptxAsymptotic Notations.pptx
Asymptotic Notations.pptx
 
Data Structure & Algorithms - Mathematical
Data Structure & Algorithms - MathematicalData Structure & Algorithms - Mathematical
Data Structure & Algorithms - Mathematical
 
Daa unit 6_efficiency of algorithms
Daa unit 6_efficiency of algorithmsDaa unit 6_efficiency of algorithms
Daa unit 6_efficiency of algorithms
 
Data structures notes for college students btech.pptx
Data structures notes for college students btech.pptxData structures notes for college students btech.pptx
Data structures notes for college students btech.pptx
 

Mais de Abha Damani (20)

Unit2
Unit2Unit2
Unit2
 
Unit6
Unit6Unit6
Unit6
 
Unit5
Unit5Unit5
Unit5
 
Unit4
Unit4Unit4
Unit4
 
Unit3
Unit3Unit3
Unit3
 
Unit 1 introduction to visual basic programming
Unit 1 introduction to visual basic programmingUnit 1 introduction to visual basic programming
Unit 1 introduction to visual basic programming
 
Ch14
Ch14Ch14
Ch14
 
Ch12
Ch12Ch12
Ch12
 
Ch11
Ch11Ch11
Ch11
 
Ch10
Ch10Ch10
Ch10
 
Ch08
Ch08Ch08
Ch08
 
Ch01 enterprise
Ch01 enterpriseCh01 enterprise
Ch01 enterprise
 
3 data mgmt
3 data mgmt3 data mgmt
3 data mgmt
 
2 it supp_sys
2 it supp_sys2 it supp_sys
2 it supp_sys
 
1 org.perf it supp_appl
1 org.perf it supp_appl1 org.perf it supp_appl
1 org.perf it supp_appl
 
Managing and securing the enterprise
Managing and securing the enterpriseManaging and securing the enterprise
Managing and securing the enterprise
 
Ch6
Ch6Ch6
Ch6
 
Unit2
Unit2Unit2
Unit2
 
Unit 3
Unit 3Unit 3
Unit 3
 
Unit 4
Unit 4Unit 4
Unit 4
 

Último

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 

Último (20)

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

Unit 1

  • 1. Introduction to DS Definition  An algorithm is a finite sequence of instructions each of which has a clear meaning and can be performed with a finite amount of effort in a finite length of time. 28 May 2012 Software Tools 1
  • 2. Structure of Algorithms  Input step  Assignment step  Decision step  Repetitive step  Output step 28 May 2012 Software Tools 2
  • 3. Properties of Algorithm  Finiteness • An algorithm must terminate after a finite number of steps.  Definiteness • Steps must be precisely defined. • No ambiguity in steps.  Generality • It must be generic enough to solve all problem of same class  Effectiveness • The steps of operations must be basic • Not too much complex  Input-Output • It must have initial and precise inputs. • Output may be generated both at intermediate and final steps.
  • 4. Data Structure and Algorithms  Data Structure • A data structure is a way of organizing data that considers not only the items stored, but also their relationship to each other.  The design of an efficient algorithm for the solution of the problem needs the use of appropriate data structure.  The program which satisfy all the properties of algorithm is not enough for efficient implementation of algorithm.
  • 5. Cont…  It is important to arrange the data in well structured manner to prepare efficient algorithm.  Thus, for the design of efficient solution of a problem, it is essential that algorithm goes hand in hand with appropriate data structure. 28 May 2012 Software Tools 5
  • 6. Efficiency of Algorithm  One problem can be solved in many ways then to choose the best one among them we required to measure the performance of algorithm.  The performance of algorithm can be measured by two main parameter: • Time • Space
  • 7. Efficiency of Algorithm (Cont…)  Empirical or posterior testing approach • Implement the complete algorithms and execute them for various instances of the problems. • The time taken for execution of the programs is noted. • Algorithm taking less time is considered as the best among all. • Its disadvantage is that it depend on various factors like –  machine on which it is executed.
  • 8. Efficiency of Algorithm (Cont…)  Programming language with which it is implemented  Skills of a programmer  Theoretical or apriori approach • Mathematically determine the resources such as time and space needed by algorithm in form of a function of a parameter related to the instance of the problem considered. • This approach is entirely machine, language and program independent. • It allows to study the efficiency of the algorithm on any input size instance.
  • 9. Asymptotic Notation  Apriori analysis uses asymptotic notations to express the time complexity of algorithms.  Asymptotic notations are meaningful approximations of functions that represent the time and space complexity of a program.
  • 10. Asymptotic Notation (Cont…)  Big O notation • f(n)=O(g(n)) (read: f of n is big oh of g of n), if there exists a positive integer n0 and a positive number c such that |f(n)|≤c|g(n)|, for all n≥n0. • It shows upper bound of a function. f(n) g(n) 16n3+12n2+12n n3 f(n) = O(n3) 34n – 90 n f(n) = O(n) 56 1 f(n) = O(1) 28 May 2012 Software Tools 10
  • 11. Asymptotic Notation (Cont…)  Omega notation • f(n)=Ω(g(n))(read: f of n is omega of g of n), if there exists a positive integer n0 and a positive integer c such that |f(n)|≥c|g(n)|, for all n≥n0. • Here g(n) indicate the lower bound of the function f(n). f(n) g(n) 16n3+12n2+12n n3 f(n) = Ω(n3) 34n – 90 n f(n) = Ω(n) 56 1 f(n) = Ω(1)
  • 12. Asymptotic Notation (Cont…)  Thita notation • f(n)= Ө(g(n))(read: f of n is thita of g of n), if there exists a positive integer n0 and a positive integer c1 and c2 such that c1|g(n)| ≤ |f(n)| ≤c2|g(n)|, for all n≥n0. • Here g(n) indicate the upper bound as well as lower bound of the function f(n). f(n) g(n) 16n3+12n2+12n n3 f(n) = Ө(n3) 34n – 90 n f(n) = Ө(n) 56 1 f(n) = Ө(1)
  • 13. Asymptotic Notation (Cont…)  Little oh notation • f(n)=o(g(n)) (read: f of n is little oh of g of n) if f(n)=O(g(n)) and f(n) ≠ Ω(g(n)). f(n) g(n) 18n3 + 9 n3 f(n) = o(n3) because f(n) = O(n3) and f(n) ≠ Ω(n3)
  • 14. Average, Best and Worst Cases  The time complexity of an algorithm is dependent on parameters associated with the input/output instances of the problem.  Many times the input size is only used to calculate the complexity, in such cases if input size is larger then execution time will be larger.  But all the time it is not appropriate to consider only the size of input for calculating complexity. 28 May 2012 Software Tools 14
  • 15. Cont…  Sometimes, the complexity is also depends on the nature of input.  For example, consider the following data for sequentially searching the first even number in the list. Input data Case -1, 3, 5, 7, -5, 11, -13, 17, 71, 9, 3, 1, -23, 39, 7, 40 Worst 6, 11, 25, 5, -5, 6, 23, -2, 26, 71, 9, 3, 1, -23, 39, 7 Best -1, 3, 11, 5, 7, -5, -13, 16, 11, 25, 5, -5, 6, 23, -2, 7 Average 28 May 2012 Software Tools 15
  • 16.  Worst case: • The input instance for which algorithm takes the maximum possible time is called the worst case. • The time complexity in such a case is called worst case time complexity.  Best case: • The input instance for which algorithm takes the minimum possible time is called the best case. • The time complexity in such a case is called best case time complexity.  Average case: • All input instances which are neither of a best case nor of a worst case are categorized as average case. • The time complexity of the algorithm in such cases is referred to as the average case complexity.