2.1.15

question:

Expensive exchange. A clerk at a shipping company is charged with the task of rearranging a number of large creates in order of the time they are to shipped out. Thus, the cost of comparies is very slow(just look at the labels) relative to the cost of exchanges (move the creates). The warehouse is nearly full--there is extra space sufficient to hold any one of the creates, but not two. What sorting method should the ckerk use?

answer:

//交换最少肯定用selection sort

//官网答案

Solution. Use selection sort because it minimizes the number of exchanges.

猜你喜欢

转载自www.cnblogs.com/w-j-c/p/9107828.html