联合开发网   搜索   要求与建议
                登陆    注册
排序按匹配   按投票   按下载次数   按上传日期
按分类查找All 其他小程序(1) 
按平台查找All Pascal(1) 

[其他小程序] A0_001

N只猴子要选大王,所有猴子按1,2,3...M报数,凡报到M的退出圈外,如此循环,直到圈内只剩一只,就是大王了. 分析:建立一个环形链表,每个猴子就是链表中的一个结点,那么猴子出圈就是对环形链表中的结点的删除,只到最后剩下的一个结点为止.
N monkeys to elect king, all the monkeys reported by a number 1,2,3 ... M, where M to report the withdrawal of outsiders, and so on, until only one circle is the king of. Analysis: the establishment of a ring linked list, each monkey is a list of a node, then the monkey out of the circle is a right circular list node removal, only to the last remaining until a node. (2009-11-08, Pascal, 1KB, 下载5次)

http://www.pudn.com/Download/item/id/963300.html
总计:1