Engaged Employer
Which algorithm will you use for sorting an array and why?
Anonymous
- You can use both Merge Sort and Quick sort to sort arrays, because array allows random access (O(1)) of elements in array by index. You need to be able to access by index for both Merge and quick sorts - However Time complexity: Merge sort :O( n logn) QuickSort = O(n logn) (average) Space complexity: Merge sort :O( n logn) QuickSort : O(n)
Check out your Company Bowl for anonymous work chats.