Fork me on GitHub
摘要: 1,循环链表方法建立一个具有n个链结点,无头结点的循环链表;确定第1个报数人的位置;不断地从链表中删除链结点,直到链表为1结点。2,数组模拟,出去的置03,数学方法,只能输出最后的代码1/* 1,构建循环链表 l为为结点 p为头结点 p=l-》next; 2,循环删除,直到剩下最后一个结点 while(p-》next=p) 删除s,p-》next=s p-》next=s-》next; free(s); s=p-》next; */ #include<stdio.h> #define N 3 struct node{ int a; struct node *next; }; int m 阅读全文
posted @ 2012-04-03 15:52 浪飞-louffy 阅读(152) 评论(0) 推荐(0) 编辑