摘要: 前序遍历 void preOrder(BiTree bt){ if (bt!=NULL){ BiTree Stack[maxSize]; int top = -1; Stack[++top]=bt; BiTree p; while (top!=1){ p=Stack[top--]; visit(p) 阅读全文
posted @ 2022-12-20 17:41 sugare 阅读(34) 评论(0) 推荐(0)
摘要: 参考自:https://blog.csdn.net/hgdzw/article/details/107613165 阅读全文
posted @ 2022-02-07 16:59 sugare 阅读(52) 评论(0) 推荐(0)
摘要: ### 冒泡排序 ``` # Here two loops would be required in sorting, the first loop for iterating and the second loop for comparing. # 总是比较相邻的两个数,称为冒泡 void Bub 阅读全文
posted @ 2021-10-31 17:10 sugare 阅读(67) 评论(0) 推荐(0)
摘要: ![](https://img2020.cnblogs.com/blog/1085852/202110/1085852-20211020205009523-255621387.png) 阅读全文
posted @ 2021-10-20 20:51 sugare 阅读(11) 评论(0) 推荐(0)
摘要: 导入头文件 编写代码过程中,涉及动态内存分配等常用的函数,需要引入如下头文件 #include<stdio.h> #include<stdlib.h> 结构体定义 // 定义二分搜索树中节点结构体 typedef struct Node { int data; struct Node * left; 阅读全文
posted @ 2020-06-26 17:49 sugare 阅读(328) 评论(0) 推荐(0)
摘要: // 代码实现过程中使用到 java.util 中的包 import java.util.LinkedList; import java.util.Queue; public class BST<E extends Comparable<E>> { // 二分搜索树中存放的数据是可比较的 // 定义 阅读全文
posted @ 2020-06-24 19:47 sugare 阅读(174) 评论(0) 推荐(0)
摘要: 1. 将U盘插到路由器 2. 通过ssh 连接到路由器 ssh root@<路由器IP> 3. 查看U盘的设备名 fdisk -l 4. 对U盘进行格式化,假设U盘是 /dev/sda1 mkfs.ext3 /dev/sda1 5. 将 U盘挂载到 /mnt 目录 mount /dev/sda1 / 阅读全文
posted @ 2020-06-19 23:33 sugare 阅读(3437) 评论(0) 推荐(0)
摘要: 1. 导入头文件 编写代码过程中,涉及动态内存分配等常用的函数,需要引入如下头文件 #include<stdio.h> #include<stdlib.h> 2. 结构体定义 len 表示初始化时的数组长度,队列的最大容量为len-1 typedef struct Queue { int * pDa 阅读全文
posted @ 2020-06-19 23:20 sugare 阅读(263) 评论(0) 推荐(0)
摘要: 1. 导入头文件 编写代码过程中,涉及动态内存分配等常用的函数,需要引入如下头文件 #include<stdio.h> #include<stdlib.h> 2. 结构体定义 // 链表节点的结构定义 typedef struct Node { int data; struct Node * nex 阅读全文
posted @ 2020-06-19 10:59 sugare 阅读(372) 评论(0) 推荐(0)
摘要: 1. 导入头文件 编写代码过程中,涉及动态内存分配等常用的函数,需要引入如下头文件 #include<stdio.h> #include<stdlib.h> 2. 结构体定义 // 链表的 Node 结构体 typedef struct Node { int data; struct Node * 阅读全文
posted @ 2020-06-18 11:20 sugare 阅读(499) 评论(0) 推荐(0)