文件名称:Bubble
介绍说明--下载内容均来自于网络,请自行研究使用
冒泡排序,依次比较相邻的两个数,将小数放在前面,大数放在后面。即在第一趟:首先比较第1个和第2个数,将小数放前,大数放后。然后比较第2个数和第3个数,将小数放前,大数放后,如此继续,直至比较最后两个数,将小数放前,大数放后。至此第一趟结束,将最大的数放到了最后。在第二趟:仍从第一对数开始比较(因为可能由于第2个数和第3个数的交换,使得第1个数不再小于第2个数),将小数放前,大数放后,一直比较到倒数第二个数(倒数第一的位置上已经是最大的),第二趟结束,在倒数第二的位置上得到一个新的最大数(其实在整个数列中是第二大的数)。如此下去,重复以上过程,直至最终完成排序。 -Bubble sort, followed by two more adjacent number on the front of the decimal, large numbers on the back. That first trip: first to compare a number 2 before the decimal, after the discharge of the large numbers. Then the comparison between the number and the number 3, the decimal put before large numbers put, so continue until the last two decimal before large numbers after release. At this point the first end of the trip, the largest number on the end. The second pass: still starting from the first logarithmic comparison (as may also be due to the second number and the third number of the exchange, so that the first number is no longer less than the number 2), the decimal Front large number put, has been compared to the reciprocal of the second number (the countdown to the first position is already the largest), the end of the second trip, to get a maximum number in the penultimate position (in fact, the entire series The second largest number). Under such circumstances, the process
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Bubble\Bubble.mdsp
......\Debug\Bubble.exe
......\.....\T1.o
......\T1.cpp
......\Debug
Bubble