摘要: #include<stdio.h> #include<stdlib.h> //用二叉链表存储方式建树(完全二叉树) typedef struct BitTree { int data; struct BitTree* LChild; //左子树 struct BitTree* RChild; //右 阅读全文
posted @ 2020-04-14 18:34 shanlu 阅读(194) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> #include<stdlib.h> //用二叉链表存储方式建树(完全二叉树) typedef struct BitTree { int data; struct BitTree* LChild; //左子树 struct BitTree* RChild; //右 阅读全文
posted @ 2020-04-14 18:30 shanlu 阅读(263) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> #include<stdlib.h> //用二叉链表存储方式建树(完全二叉树) typedef struct BitTree { int data; struct BitTree* LChild; //左子树 struct BitTree* RChild; //右 阅读全文
posted @ 2020-04-14 18:24 shanlu 阅读(371) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> #include<stdlib.h> //二叉链表 //typedef struct BitLink { // int data; // struct BitLink* leftChild; //左指针 // struct BitLink* rightChild; 阅读全文
posted @ 2020-04-14 18:00 shanlu 阅读(2811) 评论(0) 推荐(0) 编辑
摘要: //键盘输入若干个整数,按输入数据逆序建立一个带头结点的单链表(头插入创建单链表) #include<stdio.h> #include<stdlib.h> typedef struct Link { int data; struct Link* next; }link; //头插入的方式初始化链表 阅读全文
posted @ 2020-04-14 13:48 shanlu 阅读(3776) 评论(0) 推荐(0) 编辑
摘要: 有一个不带头结点的单链表L(至少有1个结点),第一个结点指针为head,编写算法将L逆置,即最后一个结点变成第一个结点,倒数第二个结点变成第二个结点,如此等等。 #include<stdio.h> #include<stdlib.h> //链表中节点的结构 typedef struct Link { 阅读全文
posted @ 2020-04-14 10:52 shanlu 阅读(482) 评论(0) 推荐(0) 编辑