#include<stdio.h>
#include<stdlib.h>
#define ok 1
#define error 0
typedef int Status;
typedef char ElemType;
typedef struct node{
int data;
struct node *prior;
struct node *next;
}Node;
Node * create(Node *L,int i){
int n;
int j=;
Node *q=L;//保存头结点
while(j<i){
Node *p;
p=(Node *)malloc(sizeof(Node));
printf("请输入结点%d的data:\n",j);
scanf("%d\n",&n);
p->data=n;
p->prior=q;
p->next=NULL;
q->next=p;
q=p;
j++; }
return L; }
Status Insert(Node *L,int i,int m){
int j=;
Node *p=NULL;
while(j<i){
L=L->next;
j++;
}
p=(Node *)malloc(sizeof(Node));
p->data=m;
p->prior=L;
p->next=L->next;
L->next->prior=p;
L->next=p;
return ok; }
void Traverse(Node *L){
L=L->next;
while(L){
printf("%d ",L->data);
L=L->next;
}
}
void main(){
int m=;
Node *p=NULL;
Node *L;
L=(Node *)malloc(sizeof(Node));
L->next=NULL;
L->prior=NULL;
p=create(L,m);
Traverse(L);
Insert(L,,);
Traverse(L);
}

最新文章

  1. SmartAssembly使用失败记录
  2. netlink优势
  3. jQuery的编码标准和最佳实践
  4. SQL Server 2008 R2——PIVOT 行转列 以及聚合函数的选择
  5. JQuery.Ajax()的data参数类型
  6. python处理url中的中文编码,以及其他编码问题
  7. 【Spring开发】—— Spring Core
  8. 无法启动ArcSDE服务
  9. 项目源码--Android即时通讯IM客户端
  10. sql之表的表达式
  11. xp主机用VMware9和10安装Ubuntu12.04后无法进入图像界面
  12. TabControl控件中TabPage的显示和隐藏
  13. opencv kmeans 图像分割
  14. 2.Lucene3.6.2包介绍,第一个Lucene案例介绍,查看索引信息的工具lukeall介绍,Luke查看的索引库内容,索引查找过程
  15. 2019-oo-第二单元总结
  16. spring-data-redis和jedis版本对应问题
  17. [20171113]修改表结构删除列相关问题.txt
  18. 2-MAVEN 基本命令
  19. memcached 一致性hash原理
  20. MyBatis拦截器的执行顺序引发的MyBatis源码分析

热门文章

  1. 121、Django rest framework入门使用
  2. Zoj 3870——Team Formation——————【技巧,规律】
  3. Aaja.pro 未定义
  4. 用ECMAscript5中的forEach函数遍历数组
  5. linux基础-wget、apt-get、yum的区别
  6. time&amp;datetime模块
  7. PHP性能检测与优化—XHProf 安装
  8. C#工具类之数据库连接
  9. @Component 注解
  10. haproxy学习——安装(一)