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

AlgorithmTime ComplexitySpace ComplexityFeaturesLinear Searc.pdf

  • 1.
    Algorithm Time Complexity Space Complexity Features LinearSearch 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: QuadraticTime 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 LinearSearch 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