Skip to main content

search-sort

Searching and sorting -#

  • Quick Sort (doesnt require any additional space) (botyh for array and linekd list) Best case Time complexity - O(nlogn) worst case Time complexity - O(n2) avg. time complexity - O(nlogn)

  • Merge Sort (requires O(n) space fro array and O(nlogn) for linked list) All 3 cases time complexity - O(nlogn) as it always divides the array into halves