#include<stdio.h>
#include<stdlib.h>
typedef int elemtype;
typedef struct DLNode
{
elemtype data;
struct DLNode* next, * front;
}DLNode, * DListlink;
DLNode* Creatlist1(DListlink& L, int n)
{
L = (DLNode*)malloc(sizeof(DLNode));
DLNode* r = L;
int x;
int i = 0;
DLNode* q;
printf("请输入你要插入的数:\n");
while (i < n)
{
q = (DLNode*)malloc(sizeof(DLNode));
scanf_s("%d", &x);
q->data = x;
r->next = q;
q->front = r;
r = q;
i++;
}
r->next = L;
L->front = r;
return L;
}
DLNode* Creatlist2(DListlink& L, int n)
{
L = (DLNode*)malloc(sizeof(DLNode));
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交