Hacker News new | past | comments | ask | show | jobs | submit
You are moving n/2 objects log(n) times, so its O(n.log(n))
Only half of the remaining boxes need to be moved, not half of the total.