Givenn, how many structurally uniqueBST's(binary search trees) that store values 1...n?For example,Givenn= 3, there are a total of 5 unique BST's. 1.....
分类:
其他好文 时间:
2014-07-02 22:13:23
阅读次数:
191
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tree andsum =...
分类:
其他好文 时间:
2014-07-02 22:10:42
阅读次数:
262
Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the below binary tree, 1 ...
分类:
其他好文 时间:
2014-07-02 21:13:05
阅读次数:
170
Same Tree 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 i...
分类:
其他好文 时间:
2014-07-02 17:56:50
阅读次数:
205
往往在一个绘图区域会有很多个图形,如果通过右键拖动画布或者通过滚动条来查找,是一件很烦人的事情。下面我就给出解决这个问题的方案。
前提是有一个整个绘图区域的tree或者datagrid,我们需要选择直接要定位的图形cell。
首先我们需要一个mxGraph的全局对象,暂且就定义为ylEditor.ylCanvas吧。
接下来我们要定义一个查找图形cell的方法,只有通过这个方法,才能找到画布...
分类:
其他好文 时间:
2014-07-02 15:26:39
阅读次数:
547
Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.
分类:
其他好文 时间:
2014-07-02 10:03:09
阅读次数:
175
(一)二分的模版:
int binary_search(int *array, int length, int key) {
int start = 0, end = length - 1;
while(end >= start) {
int middle = start + (end - start) / 2;
int tmp = array[middle];
if(tmp <...
分类:
其他好文 时间:
2014-07-02 08:19:05
阅读次数:
211
[LeetCode]Maximum Depth of Binary Tree...
分类:
其他好文 时间:
2014-07-02 08:09:01
阅读次数:
175
判断一个二叉树是否是轴对称的是一个经典的算法问题,下面结合leetcode上的Symmetric Tree给出判断对称树的两种方法。
先看看问题描述:
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).
For example, t...
分类:
其他好文 时间:
2014-07-02 06:58:05
阅读次数:
208