SlideShare a Scribd company logo
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

SolutionSolutionSolution.pdf
SolutionSolutionSolution.pdfSolutionSolutionSolution.pdf
SolutionSolutionSolution.pdf
rdtraders2007
 
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
rdtraders2007
 
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
rdtraders2007
 
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
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
 
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
rdtraders2007
 
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
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
 
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
rdtraders2007
 
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
rdtraders2007
 
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
rdtraders2007
 
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
rdtraders2007
 
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
rdtraders2007
 
B. Li Solution B. Li .pdf
                     B. Li  Solution                     B. Li  .pdf                     B. Li  Solution                     B. Li  .pdf
B. Li Solution B. Li .pdf
rdtraders2007
 
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
rdtraders2007
 
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
rdtraders2007
 
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
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

BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
Nguyen Thanh Tu Collection
 
Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"
National Information Standards Organization (NISO)
 
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
National Information Standards Organization (NISO)
 
CIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdfCIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdf
blueshagoo1
 
Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)
nitinpv4ai
 
Stack Memory Organization of 8086 Microprocessor
Stack Memory Organization of 8086 MicroprocessorStack Memory Organization of 8086 Microprocessor
Stack Memory Organization of 8086 Microprocessor
JomonJoseph58
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
TechSoup
 
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) CurriculumPhilippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
MJDuyan
 
Pharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brubPharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brub
danielkiash986
 
Data Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsxData Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsx
Prof. Dr. K. Adisesha
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
siemaillard
 
Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
MysoreMuleSoftMeetup
 
Haunted Houses by H W Longfellow for class 10
Haunted Houses by H W Longfellow for class 10Haunted Houses by H W Longfellow for class 10
Haunted Houses by H W Longfellow for class 10
nitinpv4ai
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
haiqairshad
 
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
EduSkills OECD
 
Nutrition Inc FY 2024, 4 - Hour Training
Nutrition Inc FY 2024, 4 - Hour TrainingNutrition Inc FY 2024, 4 - Hour Training
Nutrition Inc FY 2024, 4 - Hour Training
melliereed
 
Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
PsychoTech Services
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
zuzanka
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
GeorgeMilliken2
 
Bonku-Babus-Friend by Sathyajith Ray (9)
Bonku-Babus-Friend by Sathyajith Ray  (9)Bonku-Babus-Friend by Sathyajith Ray  (9)
Bonku-Babus-Friend by Sathyajith Ray (9)
nitinpv4ai
 

Recently uploaded (20)

BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
 
Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"
 
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
 
CIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdfCIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdf
 
Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)
 
Stack Memory Organization of 8086 Microprocessor
Stack Memory Organization of 8086 MicroprocessorStack Memory Organization of 8086 Microprocessor
Stack Memory Organization of 8086 Microprocessor
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
 
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) CurriculumPhilippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
 
Pharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brubPharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brub
 
Data Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsxData Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsx
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
 
Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
 
Haunted Houses by H W Longfellow for class 10
Haunted Houses by H W Longfellow for class 10Haunted Houses by H W Longfellow for class 10
Haunted Houses by H W Longfellow for class 10
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
 
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
 
Nutrition Inc FY 2024, 4 - Hour Training
Nutrition Inc FY 2024, 4 - Hour TrainingNutrition Inc FY 2024, 4 - Hour Training
Nutrition Inc FY 2024, 4 - Hour Training
 
Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
 
Bonku-Babus-Friend by Sathyajith Ray (9)
Bonku-Babus-Friend by Sathyajith Ray  (9)Bonku-Babus-Friend by Sathyajith Ray  (9)
Bonku-Babus-Friend by Sathyajith Ray (9)
 

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