![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
孤傲的比熊
这个作者很懒,什么都没留下…
展开
-
2021年2月17日 二叉树
目录1、插入节点图示2、删除节点2.1 删除的节点没有子节点2.2 删除的节点有一个子节点2.3删除节点有两个子节点3、 参考代码4、测试类5、测试结果 二叉树的插入、前序遍历、中序遍历、后序遍历、查找节点、删除节点 首先需要一个节点Node类 public class Node { public long data; public Node leftNode; public Node rightNode; Node(long value){ this.原创 2021-03-01 12:25:49 · 121 阅读 · 2 评论 -
2021-09-27 循环双链表
// // Created by 民 on 2021/9/27. // #include <iostream> using namespace std; typedef int Elem; typedef struct DLNode{ Elem data; struct DLNode *prior; struct DLNode *next; }DLNode,*DLinkList; //双链表 void Init_LinkList(DLinkList &L){原创 2021-09-27 12:08:25 · 42 阅读 · 0 评论 -
2021-09-27 循环单链表
// // Created by 民 on 2021/9/27. // #include <iostream> using namespace std; typedef int Elem; typedef struct LNode{ Elem data; struct LNode *next; }LNode,*CLinkList; //循环单链表 void Init_CLinkList(CLinkList &L){ LNode *node = new LNode原创 2021-09-27 12:07:30 · 40 阅读 · 0 评论 -
2021-09-27 单链表
// // Created by 民 on 2021/9/26. // #include <iostream> using namespace std; typedef int Elem; typedef struct LNode{ Elem data; struct LNode* next; }LNode,*LinkList; //单链表 void Init_LinkList(LinkList &L){ LNode *node = new LNode;//原创 2021-09-27 12:06:16 · 69 阅读 · 0 评论 -
2021-09-27 顺序表
顺序表 void InitSqList(SqList &L){ L.data = new Elem; L.length = 0; } bool isEmpty(SqList L){ return L.length==0; } void printSqList(SqList L){ if (isEmpty(L))return ; for (int i = 0; i < L.length; ++i) { cout<<L.dat原创 2021-09-27 12:04:27 · 58 阅读 · 0 评论