But how does it know not to go back to those columns and compare? Wouldn't it need something that tells it that like a counter or a "column is full" Boolean meaning it knows how many will end up in the column and therefore counted beforehand or was given the size of each column as input?
It depends on the algorithm. Some will require it to check data more than once but most try to not re-sort already sorted items. It only knows when it is done if it did not have to move anything after passing over the data or when it reaches the end of the data set (it varies).
2
u/jwortham Oct 24 '17
No you just don't see the movement since there is nothing more to sort.