上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 21 下一页
摘要: 前序和后序之所以不确定一棵树的原因就是当只有一棵子树的时候,不确定是左子树还是右子树。找前序的第二个结点在后续中位置,左边就是左子... 阅读全文
posted @ 2020-07-23 18:30 _Hsiung 阅读(65) 评论(0) 推荐(0) 编辑
摘要: 思路:利用层序遍历判断是否是一棵完全二叉树,给的下标同样利用二叉树的静态写法 #include#include#include#i... 阅读全文
posted @ 2020-07-23 16:07 _Hsiung 阅读(58) 评论(0) 推荐(0) 编辑
摘要: 给一棵二叉树子节点下标,要求反转二叉树,之后按要求输出层序和中序遍历。 思路:因为是给的子节点下标,用二叉树的静态写法会更加方便,... 阅读全文
posted @ 2020-07-23 11:18 _Hsiung 阅读(51) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#include#includeusing namespace std;const... 阅读全文
posted @ 2020-07-23 09:58 _Hsiung 阅读(58) 评论(0) 推荐(0) 编辑
摘要: 题目大意:给你中序后序,要求输出层序。 #include#include#includeusing namespace std;c... 阅读全文
posted @ 2020-07-23 08:59 _Hsiung 阅读(43) 评论(0) 推荐(0) 编辑
摘要: 11步 #include#includeusing namespace std;const int maxn = 100;struc... 阅读全文
posted @ 2020-07-22 17:06 _Hsiung 阅读(74) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std;char a[105][105], v[105][105];int n,... 阅读全文
posted @ 2020-07-22 11:09 _Hsiung 阅读(47) 评论(0) 推荐(0) 编辑
摘要: 全排列dfs的拓展 #include#include#includeusing namespace std;int n, val[... 阅读全文
posted @ 2020-07-22 10:00 _Hsiung 阅读(61) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#include#include#include#include#includeu... 阅读全文
posted @ 2020-07-21 23:27 _Hsiung 阅读(41) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#include#include#include#include#include#... 阅读全文
posted @ 2020-07-21 17:00 _Hsiung 阅读(62) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 21 下一页