05 2017 档案

摘要:给出一棵二叉树,返回其节点值的前序遍历。 样例 给出一棵二叉树 {1,#,2,3}, 1 \ 2 / 3 返回 [1,2,3] 挑战 你能使用非递归实现么? 标签 递归 二叉树 二叉树遍历 非递归 递归实现: 1 /** 2 * Definition of TreeNode: 3 * class T 阅读全文
posted @ 2017-05-11 22:53 小花同学 阅读(217) 评论(0) 推荐(0)
摘要:有两个不同大小的二进制树: T1 有上百万的节点; T2 有好几百的节点。请设计一种算法,判定 T2 是否为 T1的子树。 若 T1 中存在从节点 n 开始的子树与 T2 相同,我们称 T2 是 T1 的子树。也就是说,如果在 T1 节点 n 处将树砍断,砍断的部分将与 T2 完全相同。 ***** 阅读全文
posted @ 2017-05-11 22:29 小花同学 阅读(369) 评论(0) 推荐(0)
摘要:为了加强记忆我又写了一遍二叉树的基本代码。比上一次多了一点点功能。 小白在成长 阅读全文
posted @ 2017-05-11 11:32 小花同学 阅读(135) 评论(0) 推荐(0)
摘要:#include #include using namespace std; struct BitreeNode{ int value; BitreeNode *left,*right; }; BitreeNode creat(BitreeNode *&t) { int ch; scanf("%d",&ch); if(ch==0) //以0为结束判断 ... 阅读全文
posted @ 2017-05-10 22:07 小花同学 阅读(103) 评论(0) 推荐(0)
摘要:Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 35940 Accepted Submission(s): 13552 Problem Descr 阅读全文
posted @ 2017-05-08 17:09 小花同学 阅读(133) 评论(0) 推荐(0)
摘要:Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 60452 Accepted Submission(s): 28262 Problem Descr 阅读全文
posted @ 2017-05-08 11:35 小花同学 阅读(156) 评论(0) 推荐(0)
摘要:Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 45655 Accepted Submission(s): 20188 Problem Descr 阅读全文
posted @ 2017-05-08 00:32 小花同学 阅读(258) 评论(0) 推荐(0)
摘要:Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 51959 Accepted Submission(s): 19706 Problem Descr 阅读全文
posted @ 2017-05-07 20:31 小花同学 阅读(188) 评论(0) 推荐(0)
摘要:Problem Description In many applications very large integers numbers are required. Some of these applications are using keys for secure transmission o 阅读全文
posted @ 2017-05-07 20:06 小花同学 阅读(157) 评论(0) 推荐(0)
摘要:Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 28661 Accepted Submission(s): 11402 Problem Descr 阅读全文
posted @ 2017-05-07 19:28 小花同学 阅读(126) 评论(0) 推荐(0)
摘要:Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 77880 Accepted Submission(s): 24325 Problem Descr 阅读全文
posted @ 2017-05-07 14:14 小花同学 阅读(149) 评论(0) 推荐(0)
摘要:A simple mathematical formula for e iswhere n is allowed to go to infinity. This can actually yield very accurate approximations of e using relatively 阅读全文
posted @ 2017-05-07 13:50 小花同学 阅读(134) 评论(0) 推荐(0)
摘要:Problem Description FatMouse prepared M pounds of cat food, ready to trade with the cats guarding the warehouse containing his favorite food, JavaBean 阅读全文
posted @ 2017-05-07 09:29 小花同学 阅读(126) 评论(0) 推荐(0)
摘要:Problem Description The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at w 阅读全文
posted @ 2017-05-07 08:25 小花同学 阅读(150) 评论(0) 推荐(0)
摘要:Problem Description A number sequence is defined as follows:f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7.Given A, B, and n, you are 阅读全文
posted @ 2017-05-06 21:16 小花同学 阅读(175) 评论(0) 推荐(0)
摘要:Contest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges' favorite time is guessing the most popula 阅读全文
posted @ 2017-05-06 20:53 小花同学 阅读(115) 评论(0) 推荐(0)