文章
37
粉丝
98
获赞
4
访问
21.8k
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
struct node {
int data;
struct node * next;
};
struct node* create(int n) {
struct node *head=NULL,*q;
for (int i = 1; i <=n; i++) {
struct node *p = (struct node*)malloc(sizeof(struct node));
p->data = i;
if (head == NULL) {
head = p;
p->next = head;
}
else {
q = head;
//尾插法
while (q->next != head) {
 ...
登录后发布评论
暂无评论,来抢沙发