Hacker News new | ask | show | jobs
by blueflow 1453 days ago
This somewhat looks like bubble-sort minus the early exit.
2 comments

It 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.
It is BubbleSort. At least that's how I've learned it in the 80s.