I think this is Quick sort. Here we can see the following steps:
Random selection of a reference element in an array (pivotValue) with respect to which array elements are reordered.
Move all the values โโthat are larger than the link to the right, and all the values โโremaining below.
Repeat the algorithm to unsort the left and right parts of the array, while each element will not be displayed in its position
Why do I think so:
This is definitely not a Bubble Sort, because it compares the first two elements of the array, so the first step should be 2 5 6 1 3 4
This is not an insertion sort, because it is a sequential algorithm. In the first step, we see that we compared the first and last elements
This is not a sort of selection, because it finds the lowest value and moves it up, so the first step should be 1 5 2 6 3 4
This is not Merge sorting because the array is split into two subarrays. In this case, we see the interaction of the "first" and "second" parts
source share