SlideShare a Scribd company logo
1 of 6
Download to read offline
Algorithm
Time Complexity
Space Complexity
Features
Linear Search
O(n)
O(1)
Time: Linear time
Space: Constant time
Memory: In-place
Feature: sequential search, brute-force search
Binary Search
O(log n)
O(1)
Time: Logarithmic Time
Space: Constant time
Memory: not
Feature: divide-and-conquer
Selection Sort
O(n^2)
O(1)
Time: Quadratic Time
Space: Constant time
Memory: In-place
Feature: not stable
Insertion Sort
O(n)
O(1)
Time: Linear Time
Space: Constant time
Memory: In-place
Feature: sequential search
Bubble Sort
O(n)
O(1)
Time: Linear Time
Space: Constant time
Memory: not & in-place both variants
Feature: largest element has bubbled to the top of the array
Merge Sort
O(n log (n))
O(n)
Time: Linearithmic time
Space: Linear time
Memory: not
Feature: divide-and-conquer
Quick Sort
O(n log (n))
O(n)
Time: Linearithmic time
Space: Linear time
Memory: In-place
Feature: divide-and-conquer,recursive
Algorithm
Time Complexity
Space Complexity
Features
Linear Search
O(n)
O(1)
Time: Linear time
Space: Constant time
Memory: In-place
Feature: sequential search, brute-force search
Binary Search
O(log n)
O(1)
Time: Logarithmic Time
Space: Constant time
Memory: not
Feature: divide-and-conquer
Selection Sort
O(n^2)
O(1)
Time: Quadratic Time
Space: Constant time
Memory: In-place
Feature: not stable
Insertion Sort
O(n)
O(1)
Time: Linear Time
Space: Constant time
Memory: In-place
Feature: sequential search
Bubble Sort
O(n)
O(1)
Time: Linear Time
Space: Constant time
Memory: not & in-place both variants
Feature: largest element has bubbled to the top of the array
Merge Sort
O(n log (n))
O(n)
Time: Linearithmic time
Space: Linear time
Memory: not
Feature: divide-and-conquer
Quick Sort
O(n log (n))
O(n)
Time: Linearithmic time
Space: Linear time
Memory: In-place
Feature: divide-and-conquer,recursive
Solution
Algorithm
Time Complexity
Space Complexity
Features
Linear Search
O(n)
O(1)
Time: Linear time
Space: Constant time
Memory: In-place
Feature: sequential search, brute-force search
Binary Search
O(log n)
O(1)
Time: Logarithmic Time
Space: Constant time
Memory: not
Feature: divide-and-conquer
Selection Sort
O(n^2)
O(1)
Time: Quadratic Time
Space: Constant time
Memory: In-place
Feature: not stable
Insertion Sort
O(n)
O(1)
Time: Linear Time
Space: Constant time
Memory: In-place
Feature: sequential search
Bubble Sort
O(n)
O(1)
Time: Linear Time
Space: Constant time
Memory: not & in-place both variants
Feature: largest element has bubbled to the top of the array
Merge Sort
O(n log (n))
O(n)
Time: Linearithmic time
Space: Linear time
Memory: not
Feature: divide-and-conquer
Quick Sort
O(n log (n))
O(n)
Time: Linearithmic time
Space: Linear time
Memory: In-place
Feature: divide-and-conquer,recursive
Algorithm
Time Complexity
Space Complexity
Features
Linear Search
O(n)
O(1)
Time: Linear time
Space: Constant time
Memory: In-place
Feature: sequential search, brute-force search
Binary Search
O(log n)
O(1)
Time: Logarithmic Time
Space: Constant time
Memory: not
Feature: divide-and-conquer
Selection Sort
O(n^2)
O(1)
Time: Quadratic Time
Space: Constant time
Memory: In-place
Feature: not stable
Insertion Sort
O(n)
O(1)
Time: Linear Time
Space: Constant time
Memory: In-place
Feature: sequential search
Bubble Sort
O(n)
O(1)
Time: Linear Time
Space: Constant time
Memory: not & in-place both variants
Feature: largest element has bubbled to the top of the array
Merge Sort
O(n log (n))
O(n)
Time: Linearithmic time
Space: Linear time
Memory: not
Feature: divide-and-conquer
Quick Sort
O(n log (n))
O(n)
Time: Linearithmic time
Space: Linear time
Memory: In-place
Feature: divide-and-conquer,recursive

More Related Content

More from rdtraders2007

Please find the required program along with the comments against eac.pdf
Please find the required program along with the comments against eac.pdfPlease find the required program along with the comments against eac.pdf
Please find the required program along with the comments against eac.pdf
rdtraders2007
 
An Operating System (OS) is an interface between a computer user and.pdf
An Operating System (OS) is an interface between a computer user and.pdfAn Operating System (OS) is an interface between a computer user and.pdf
An Operating System (OS) is an interface between a computer user and.pdf
rdtraders2007
 
Internal Evidence General.pdf
                    Internal Evidence                          General.pdf                    Internal Evidence                          General.pdf
Internal Evidence General.pdf
rdtraders2007
 
In reaction # 3 either the cis or trans diol may .pdf
                     In reaction # 3 either the cis or trans diol may .pdf                     In reaction # 3 either the cis or trans diol may .pdf
In reaction # 3 either the cis or trans diol may .pdf
rdtraders2007
 
Crayfish contain an exoskeleton which means it needs to get rid of i.pdf
Crayfish contain an exoskeleton which means it needs to get rid of i.pdfCrayfish contain an exoskeleton which means it needs to get rid of i.pdf
Crayfish contain an exoskeleton which means it needs to get rid of i.pdf
rdtraders2007
 

More from rdtraders2007 (20)

SolutionSolutionSolution.pdf
SolutionSolutionSolution.pdfSolutionSolutionSolution.pdf
SolutionSolutionSolution.pdf
 
slope = f(x) x= 12012= 10Solutionslope = f(x) x= 120.pdf
slope = f(x) x= 12012= 10Solutionslope = f(x) x= 120.pdfslope = f(x) x= 12012= 10Solutionslope = f(x) x= 120.pdf
slope = f(x) x= 12012= 10Solutionslope = f(x) x= 120.pdf
 
s(s^2-b^2)Solutions(s^2-b^2).pdf
s(s^2-b^2)Solutions(s^2-b^2).pdfs(s^2-b^2)Solutions(s^2-b^2).pdf
s(s^2-b^2)Solutions(s^2-b^2).pdf
 
Question not visible. Please update the question and then i can answ.pdf
Question not visible. Please update the question and then i can answ.pdfQuestion not visible. Please update the question and then i can answ.pdf
Question not visible. Please update the question and then i can answ.pdf
 
Please find the required program along with the comments against eac.pdf
Please find the required program along with the comments against eac.pdfPlease find the required program along with the comments against eac.pdf
Please find the required program along with the comments against eac.pdf
 
Order the steps of the viral life cycle.1. viral entry into host.pdf
Order the steps of the viral life cycle.1. viral entry into host.pdfOrder the steps of the viral life cycle.1. viral entry into host.pdf
Order the steps of the viral life cycle.1. viral entry into host.pdf
 
Listing of the type of alleles present in an organisms cellGenotyp.pdf
Listing of the type of alleles present in an organisms cellGenotyp.pdfListing of the type of alleles present in an organisms cellGenotyp.pdf
Listing of the type of alleles present in an organisms cellGenotyp.pdf
 
An Operating System (OS) is an interface between a computer user and.pdf
An Operating System (OS) is an interface between a computer user and.pdfAn Operating System (OS) is an interface between a computer user and.pdf
An Operating System (OS) is an interface between a computer user and.pdf
 
Internal Evidence General.pdf
                    Internal Evidence                          General.pdf                    Internal Evidence                          General.pdf
Internal Evidence General.pdf
 
In reaction # 3 either the cis or trans diol may .pdf
                     In reaction # 3 either the cis or trans diol may .pdf                     In reaction # 3 either the cis or trans diol may .pdf
In reaction # 3 either the cis or trans diol may .pdf
 
Intermolecular forces exist between molecules and.pdf
                     Intermolecular forces exist between molecules and.pdf                     Intermolecular forces exist between molecules and.pdf
Intermolecular forces exist between molecules and.pdf
 
H2 concentration will decrease and H2O concentrat.pdf
                     H2 concentration will decrease and H2O concentrat.pdf                     H2 concentration will decrease and H2O concentrat.pdf
H2 concentration will decrease and H2O concentrat.pdf
 
elemental form of sodium and hydrogen is very rea.pdf
                     elemental form of sodium and hydrogen is very rea.pdf                     elemental form of sodium and hydrogen is very rea.pdf
elemental form of sodium and hydrogen is very rea.pdf
 
C. Both A and B are correct .pdf
                     C. Both A and B are correct                      .pdf                     C. Both A and B are correct                      .pdf
C. Both A and B are correct .pdf
 
C gained 2 hydrogen. It was reduced. It is theref.pdf
                     C gained 2 hydrogen. It was reduced. It is theref.pdf                     C gained 2 hydrogen. It was reduced. It is theref.pdf
C gained 2 hydrogen. It was reduced. It is theref.pdf
 
B. Li Solution B. Li .pdf
                     B. Li  Solution                     B. Li  .pdf                     B. Li  Solution                     B. Li  .pdf
B. Li Solution B. Li .pdf
 
A is stronger acid because it give more H+ to sol.pdf
                     A is stronger acid because it give more H+ to sol.pdf                     A is stronger acid because it give more H+ to sol.pdf
A is stronger acid because it give more H+ to sol.pdf
 
Error message number = int(input(Enter a number ))     Name.pdf
Error message number = int(input(Enter a number ))     Name.pdfError message number = int(input(Enter a number ))     Name.pdf
Error message number = int(input(Enter a number ))     Name.pdf
 
Dear,The answer is .7.SolutionDear,The answer is .7..pdf
Dear,The answer is .7.SolutionDear,The answer is .7..pdfDear,The answer is .7.SolutionDear,The answer is .7..pdf
Dear,The answer is .7.SolutionDear,The answer is .7..pdf
 
Crayfish contain an exoskeleton which means it needs to get rid of i.pdf
Crayfish contain an exoskeleton which means it needs to get rid of i.pdfCrayfish contain an exoskeleton which means it needs to get rid of i.pdf
Crayfish contain an exoskeleton which means it needs to get rid of i.pdf
 

Recently uploaded

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Recently uploaded (20)

This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 

AlgorithmTime ComplexitySpace ComplexityFeaturesLinear Searc.pdf

  • 1. Algorithm Time Complexity Space Complexity Features Linear Search O(n) O(1) Time: Linear time Space: Constant time Memory: In-place Feature: sequential search, brute-force search Binary Search O(log n) O(1) Time: Logarithmic Time Space: Constant time Memory: not Feature: divide-and-conquer Selection Sort O(n^2) O(1) Time: Quadratic Time Space: Constant time Memory: In-place Feature: not stable Insertion Sort O(n) O(1) Time: Linear Time Space: Constant time Memory: In-place Feature: sequential search Bubble Sort O(n) O(1)
  • 2. Time: Linear Time Space: Constant time Memory: not & in-place both variants Feature: largest element has bubbled to the top of the array Merge Sort O(n log (n)) O(n) Time: Linearithmic time Space: Linear time Memory: not Feature: divide-and-conquer Quick Sort O(n log (n)) O(n) Time: Linearithmic time Space: Linear time Memory: In-place Feature: divide-and-conquer,recursive Algorithm Time Complexity Space Complexity Features Linear Search O(n) O(1) Time: Linear time Space: Constant time Memory: In-place Feature: sequential search, brute-force search Binary Search O(log n) O(1) Time: Logarithmic Time Space: Constant time Memory: not Feature: divide-and-conquer
  • 3. Selection Sort O(n^2) O(1) Time: Quadratic Time Space: Constant time Memory: In-place Feature: not stable Insertion Sort O(n) O(1) Time: Linear Time Space: Constant time Memory: In-place Feature: sequential search Bubble Sort O(n) O(1) Time: Linear Time Space: Constant time Memory: not & in-place both variants Feature: largest element has bubbled to the top of the array Merge Sort O(n log (n)) O(n) Time: Linearithmic time Space: Linear time Memory: not Feature: divide-and-conquer Quick Sort O(n log (n)) O(n) Time: Linearithmic time Space: Linear time Memory: In-place Feature: divide-and-conquer,recursive
  • 4. Solution Algorithm Time Complexity Space Complexity Features Linear Search O(n) O(1) Time: Linear time Space: Constant time Memory: In-place Feature: sequential search, brute-force search Binary Search O(log n) O(1) Time: Logarithmic Time Space: Constant time Memory: not Feature: divide-and-conquer Selection Sort O(n^2) O(1) Time: Quadratic Time Space: Constant time Memory: In-place Feature: not stable Insertion Sort O(n) O(1) Time: Linear Time Space: Constant time Memory: In-place Feature: sequential search Bubble Sort O(n)
  • 5. O(1) Time: Linear Time Space: Constant time Memory: not & in-place both variants Feature: largest element has bubbled to the top of the array Merge Sort O(n log (n)) O(n) Time: Linearithmic time Space: Linear time Memory: not Feature: divide-and-conquer Quick Sort O(n log (n)) O(n) Time: Linearithmic time Space: Linear time Memory: In-place Feature: divide-and-conquer,recursive Algorithm Time Complexity Space Complexity Features Linear Search O(n) O(1) Time: Linear time Space: Constant time Memory: In-place Feature: sequential search, brute-force search Binary Search O(log n) O(1) Time: Logarithmic Time Space: Constant time Memory: not
  • 6. Feature: divide-and-conquer Selection Sort O(n^2) O(1) Time: Quadratic Time Space: Constant time Memory: In-place Feature: not stable Insertion Sort O(n) O(1) Time: Linear Time Space: Constant time Memory: In-place Feature: sequential search Bubble Sort O(n) O(1) Time: Linear Time Space: Constant time Memory: not & in-place both variants Feature: largest element has bubbled to the top of the array Merge Sort O(n log (n)) O(n) Time: Linearithmic time Space: Linear time Memory: not Feature: divide-and-conquer Quick Sort O(n log (n)) O(n) Time: Linearithmic time Space: Linear time Memory: In-place Feature: divide-and-conquer,recursive