3 ms·
This somewhat looks like bubble-sort minus the early exit.
by blueflow 4y ago
This somewhat looks like bubble-sort minus the early exit.
- zajio1am 4y agoIt is just quirky insert-sort. In each outer cycle, it inserts value originally from the A[i] position to already sorted sequence A[1]..A[i-1], while using A[i] as a temporary variable to shift higher part of the sorted sequence one position up.
- MrYellowP 4y agoIt is BubbleSort. At least that's how I've learned it in the 80s.