Which sorting algorithm is this? -
i need know sorting algorithm sorts this:
[4 1 7 6 3 11] [4 1 7 3 6 11] [4 1 3 7 6 11] [1 4 3 7 6 11] [1 4 3 6 7 11] [1 3 4 6 7 11]
tomorrow exam, , i'm confused. shall simple algorithm, can't insertion sort / selection sort, looked @ heapsort (absolutely) , merge sort - last option.
i it's mergesort, addition should easy, i'm unsure. or heavily misunderstood how algorithms work. :(
thanks reading, @ least! :)
as can see, algorithm works comparing 2 adjacent values, makes bubble sort, interesting thing note here instead of sorting being done in left right passes, seems doing them in passes right left; in turn makes reversed bubble sort.
Comments
Post a Comment