由于智力的问题,百度之星完全lu不动。。开场看第一题根据题目给的条件我觉得一定是可以构造出来的,题目给的意思颇有鸽巢原理的感觉,于是觉得开场第一题应该就是智力构造题了,想了半个小时,发现完全想不动,于是只能放弃了去想后面的题。然后看第二题的数据结构,树上的询问,支持点修改,询问子树和,还有换根,然后...
分类:
其他好文 时间:
2014-06-02 16:41:08
阅读次数:
257
2014-06-02
BaoXinjian一、摘要实现OAF的Tree功能二、案例需求:实现OAF的Tree功能1. 建立两个Page,树结构页面和明细页面2.
在树页面中建立Tree,在Tree中建立Node和 Members(1). Node的重要属性URI:OA.jsp?page=/bxj/o...
分类:
其他好文 时间:
2014-06-02 11:07:08
阅读次数:
373
【题目】
Given two binary trees, write a function to check if they are equal or not.
Two binary trees are considered equal if they are structurally identical and the nodes have the same value.
【题意】
判断了两个二叉树是否相等
【思路】
递归...
分类:
其他好文 时间:
2014-06-02 11:03:03
阅读次数:
205
【题目】
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).
For example, this binary tree is symmetric:
1
/ 2 2
/ \ / 3 4 4 3
But the following is not:
1
/ 2 2
\ 3 3
No...
分类:
其他好文 时间:
2014-06-02 10:56:14
阅读次数:
237
【题目】
Two elements of a binary search tree (BST) are swapped by mistake.
Recover the tree without changing its structure.
Note:
A solution using O(n) space is pretty straight forward. Could you devise a constant space solution?
confused what "{1,#,2,3}" ...
分类:
其他好文 时间:
2014-06-02 10:38:17
阅读次数:
246
【题目】
Given a binary tree, determine if it is a valid binary search tree (BST).
Assume a BST is defined as follows:
The left subtree of a node contains only nodes with keys less than the node's key.
The right subtree of a node contains only nodes with ke...
分类:
其他好文 时间:
2014-06-02 10:29:55
阅读次数:
257
2014-06-02
BaoXinjian一、摘要实现OAF的HGrid的功能二、案例需求:实现OAF的HGrid的功能1. 建立HGrid Regin2. 建立Tree Regin
(1). Tree Node (2). Tree Members3. 建立Table Selection - Mul...
分类:
其他好文 时间:
2014-06-02 10:17:43
阅读次数:
247
lca的做法还是很明显的,简单粗暴,
不过不是正解,如果树是长链就会跪,直接变成O(n)、、
最后跑的也挺快,出题人还是挺阳光的。。
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#inclu...
分类:
其他好文 时间:
2014-06-01 15:39:05
阅读次数:
256
【题目】
Given a binary tree, return the inorder traversal of its nodes' values.
For example:
Given binary tree {1,#,2,3},
1
2
/
3
return [1,3,2].
Note: Recursive solution is trivial, could you do it iteratively?
confused what "{1,#,2...
分类:
其他好文 时间:
2014-06-01 13:01:23
阅读次数:
279