DEV Community

[Comment from a deleted post]
Collapse
 
mrheer profile image
He Linming

In above example, Binary insertion sort requires 2 iterations to find a location to insert 8.

I think it should requires 3 iterations.

  1. 0-7, mid=3
  2. 0-3, mid=1
  3. 1-3, mid=2