This website requires Javascript to function properly. Please go to the setting of your web browser and enable Javascript for this website.
×
Loading...
Close
Home
Share
对数组从尾到头做冒泡排序,后面的比前面的小就交换,相等就将其置成100。最终结果是存在的n个数放在前面连续的项里,后面跟(99-n)个100。然后定义一个初值1步长1的比较器,从头开始比较,与数组项不等就输出,相等就比较下一个项。
yifan
(yifan)
(#240921@0)
Last Updated: 2001-10-28
This post has been archived. It cannot be replied.
Share
Report
Replies, comments and Discussions:
我也来道微软试题。一个数组长度99, 由1-100中的99个数字组成。请给出一个最快算法,用尽可能少的内存,算出不在数组中的数字。
枫下论坛主坛
/
枫下拾英
/
心情随笔