随笔分类 - 

求树的某一层的节点最多
摘要:#include using namespace std; #define N 110 #define P pair int n,m; int lev[N],head[N],cnt=0; struct Node{ int fr,to,next; Node(){} Node(int fr,int to,int next):fr(fr),to(to),next(ne... 阅读全文

posted @ 2019-09-19 16:48 cltt 阅读(314) 评论(0) 推荐(0) 编辑

PAt 1099
摘要:1099 Build A Binary Search Tree (30 分) 1099 Build A Binary Search Tree (30 分) 1099 Build A Binary Search Tree (30 分) A Binary Search Tree (BST) is rec 阅读全文

posted @ 2019-09-18 22:57 cltt 阅读(137) 评论(0) 推荐(0) 编辑

完全二叉树
摘要:H: CBT? 时间限制: 1 s 内存限制: 128 MB 提交 我的状态 题目描述 对于二叉树,如果这棵树的节点排布是按行从上到下,每行从左到右挨个放置,中间不会有空闲的节点。则我们称之为完全二叉树。 注:这棵树的根节点的值一定是1 输入 输入数字正整数n (1≤n≤201≤n≤20) 接下来n 阅读全文

posted @ 2018-12-01 19:53 cltt 阅读(262) 评论(0) 推荐(0) 编辑

L2-006 树的遍历 RTA
摘要:给定一棵二叉树的后序遍历和中序遍历,请你输出其层序遍历的序列。这里假设键值都是互不相等的正整数。 输入格式: 输入第一行给出一个正整数N(<=30),是二叉树中结点的个数。第二行给出其后序遍历序列。第三行给出其中序遍历序列。数字间以空格分隔。 输出格式: 在一行中输出该树的层序遍历的序列。数字间以1 阅读全文

posted @ 2018-08-09 16:05 cltt 阅读(164) 评论(0) 推荐(0) 编辑

建立,查询二叉树 hdu 5444
摘要:Elven Postman Time Limit: 1500/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 2526 Accepted Submission(s): 1493 阅读全文

posted @ 2018-08-08 09:52 cltt 阅读(193) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示