A Common-Sense Guide to Data Structures and Algorithms, Second Edition: Insertion Sort Explanation Error (page 85)

@jaywengrow

While reading Chapter 6, I might have spotted a little error in the Insertion Sort Explanation part on page 85, where it says “If at any point we encounter a value at position that is greater or equal to the temp value, we can get ready to end our pass-through, since it’s time to move the temp_value into the gap.”

I think it should be “If at any point we encounter a value at position that is less than or equal to the temp value, we can get ready to end our pass-through, since it’s time to move the temp_value into the gap.” Since we stop the pass-through only when we encounter a value that is less than the temp_value, I think the explanation should say “less than”, rather than “greater”.

1 Like

Agreed!

1 Like