Amazon interview question

What sorting algorithm I would use for sorting an array?

Interview Answers

Anonymous

May 9, 2019

Depends on the size of the array. Insertion sort for small, quick sort for large

2

Anonymous

Apr 1, 2019

Quick sort

2

Anonymous

May 9, 2019

Also, if array is in ascending or descending order QS will be n^2. Would be better to use merge sort.