Question d’entretien chez LinkedIn

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

Réponse à la question d'entretien

Utilisateur anonyme

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