
链表
qq_42961473
这个作者很懒,什么都没留下…
展开
-
约瑟夫环
用循环链表模拟约瑟夫问题,把41个人自杀的顺序输出。(从1报数,每次数到3的人自杀) #include<stdio.h> #include<stdlib.h> typedef struct node { int data; struct node *next; }node; node *creat(int n) { int i; node *head=NULL,*p,*s;...原创 2019-06-05 16:14:30 · 133 阅读 · 0 评论 -
约瑟夫环加强版
#include<stdio.h> #include<stdlib.h> typedef struct node { int data; struct node * next; }node; node * creat(int n) { int i; node p=NULL, head,* s; head=(node* )malloc(sizeof(node)); p=hea...原创 2019-06-06 17:34:39 · 289 阅读 · 1 评论