这几天把毕业答辩的事弄完了,于是买票出来玩,结果周六是百度之星的复赛,于是我就没有办法来做比赛了,不过看了看题,目测可以过我两三道题.今天已经是比赛的第二天了,我还一直没有时间来A掉这些题,今晚抽空先把最简单的线段树那道题A了再说.题目说的很清楚了,自己看吧.有一棵树,树的每个点有点权,每次有三种操...
分类:
其他好文 时间:
2014-06-02 16:00:42
阅读次数:
225
这几天把毕业答辩的事弄完了,于是买票出来玩,结果周六是百度之星的复赛,于是我就没有办法来做比赛了,不过看了看题,目测可以过我两三道题.
今天已经是比赛的第二天了,我还一直没有时间来A掉这些题,今晚抽空先把最简单的线段树那道题A了再说.
题目说的很清楚了,自己看吧.
有一棵树,树的每个点有点权,每次有三种操作:
1. Query x 表示查询以x为根的子树的权值和。
2. Change x y 表示把x点的权值改为y(0<=y<=100)。
3. Root x 表示把x变为根。...
分类:
其他好文 时间:
2014-06-02 15:04:03
阅读次数:
298
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