文件名称:Josephus
介绍说明--下载内容均来自于网络,请自行研究使用
Josephus问题:一群小孩围成一圈,任意假定一个数m,从第一个小孩起,顺时针方向数,每数到第m个小孩是,该小孩便离开。小孩不断离开,圈子不断缩小。最后,剩下的一个小孩便是胜利者。究竟胜利的是第几个小孩呢?
提示:用循环链表解答,编写程序link.h实现循环的链表类,由插入与删除等基本操作。
-Josephus problem: a group of kids form a circle, any assumption that a number of m, starting from the first child, the number of clockwise direction, each number to the first m a child is the child and then left. Children continue to leave the circle shrinks. Finally, the remaining child is a winner. What victory is the first of several children feel? Tip: The circular list answers to achieve the cycle of programming link.h list class, from basic operations such as insertions and deletions.
提示:用循环链表解答,编写程序link.h实现循环的链表类,由插入与删除等基本操作。
-Josephus problem: a group of kids form a circle, any assumption that a number of m, starting from the first child, the number of clockwise direction, each number to the first m a child is the child and then left. Children continue to leave the circle shrinks. Finally, the remaining child is a winner. What victory is the first of several children feel? Tip: The circular list answers to achieve the cycle of programming link.h list class, from basic operations such as insertions and deletions.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
main.cpp
link.h
link.h