Why don't I just keep track on each pass through the algorithm whether I have done any swaps?
我为什么不仅仅跟踪算法的,每一遍来看看我做了哪些交换呢?
All right? Because if I don't do any swaps on a pass through the algorithm, then it says everything's in the right order.
好么?因为如果我,这一遍没有做任何交换,那么就意味着已经排好序了。
应用推荐