资 源 简 介
通常的冒泡是单向的,而这里是双向的,也就是说还要进行反向的工作。 代码看起来复杂,仔细理一下就明白了,是一个来回震荡的方式。 写这段代码的作者认为这样可以在冒泡的基础上减少一些交换(我不这么认为,也许我错了)。 反正我认为这是一段有趣的代码,值得一看。-The bubble is usually a one-way, and here is a two-way, that is to say the job would also like to reverse. The complexity of the code look carefully you will understand the rationale for it is a shock the way back and forth. Author of Writing the code that this can reduce the bubble on the basis of the exchange (I do not think so, I may be wrong). Anyway, I think this is a fun code, worth a visit.