* shrinking the gap to 1. Early large-gap passes move elements long distances * cheaply, removing many inversions before the final gap-1 pass.
These implementations are for demonstration purposes. They are less efficient than the implementations in the Python standard library.