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.
Only half of the remaining boxes need to be moved, not half of the total.