Compare the performance of each algorithm Selection Sort Ins
Compare the performance of each algorithm: Selection Sort, Insertion Sort, Bubble Sort, Binary search and Linear search
Solution
selection sort
=>in worst case time complexity is O(n^2)
 =>in best case time complexity is O(n^2)
 =>in avergae case time complexity is O(n^2)
 =>space complexity is :O(1)
insertion sort
=>in worst case time complexity is O(n^2)
 =>in best case time complexity is O(n)
 =>in avergae case time complexity is O(n^2)
 =>space complexity is :O(1)
bubble sort
=>in worst case time complexity is O(n^2)
 =>in best case time complexity is O(n)
 =>in avergae case time complexity is O(n^2)
 =>space complexity is :O(1)
 binary search
=>in worst case time complexity is O(log n)
 =>in best case time complexity is O(1)
 =>in avergae case time complexity is O(log n )
 => space complexity is :O(1)
 linear search
=>in worst case time complexity is O(n)
 =>in best case time complexity is O(1)
 =>in avergae case time complexity is O(n )
 =>space complexity is :O(1)

