Like Selection Sort,Insertion Sort also derives its name from the algorithm
used to sort the array.The basic approach to an Insertion Sort is to sort ele-
ments much like a card player arranges the cards in sorted order in his or
her hand.The player inserts cards one at a time in such a way that the cards
on the left side ofhis or her hand are sorted at all times; the cards on the
right side of his or her hand have not yet been inserted into the sorted part
ofthe hand.As Figure 8.23a shows,the three yello ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.