Suppose that you can select the pivot of the quick sort algorithm with three methods: you can select the first item, last item, or middle item as the pivot. Indicate the method(s) that gives the most efficient result to sort the following arrays. Note that you MUST indicate all methods that give the most efficient result.

Arrays Method(s)
1 2 3 4 5 6 7 8 9
2 2 2 2 4 2 2 2 2
5 5 5 5 5 5 5 5 5

1 answer

do it by yourself :)