Amazon interview question

What sorting algorithm I would use for sorting an array?

Interview Answers

Anonymous

9 May 2019

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

2

Anonymous

1 Apr 2019

Quick sort

2

Anonymous

9 May 2019

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