J
Jabba Laci
Hi,
Could someone please tell me what the following sorting algorithm is called?
Let an array contain the elements a_1, a_2, ..., a_N. Then:
for i = 1 to N-1:
for j = i+1 to N:
if a_j < a_i then swap(a_j, a_i)
It's so simple that it's not mentioned anywhere. I guess it's called
"selection sort" but I'm not sure. The minimum selection sort is an
improvement of this one.
Thanks,
Laszlo
Could someone please tell me what the following sorting algorithm is called?
Let an array contain the elements a_1, a_2, ..., a_N. Then:
for i = 1 to N-1:
for j = i+1 to N:
if a_j < a_i then swap(a_j, a_i)
It's so simple that it's not mentioned anywhere. I guess it's called
"selection sort" but I'm not sure. The minimum selection sort is an
improvement of this one.
Thanks,
Laszlo