Frage im Vorstellungsgespräch bei LinkedIn

Which algorithm will you use for sorting an array and why?

Antwort im Vorstellungsgespräch

Anonym

19. März 2012

- 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)