Insertion Sort with binary search
问题 When implementing Insertion Sort, a binary search could be used to locate the position within the first i - 1 elements of the array into which element i should be inserted. How would this affect the number of comparisons required? How would using such a binary search affect the asymptotic running time for Insertion Sort? I'm pretty sure this would decrease the number of comparisons, but I'm not exactly sure why. 回答1: Straight from Wikipedia: If the cost of comparisons exceeds the cost of