Given a strings1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representation...
分类:
其他好文 时间:
2015-07-16 00:36:56
阅读次数:
151
A. Lala Land and Apple Trees
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Amr lives in Lala Land. Lala Land...
分类:
移动开发 时间:
2015-07-15 22:53:57
阅读次数:
301
题目地址:点击打开链接
解法一:对于深度过高的case过不了。
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NU...
分类:
其他好文 时间:
2015-07-15 22:53:52
阅读次数:
163
Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.public class Solution { public...
分类:
其他好文 时间:
2015-07-15 22:39:04
阅读次数:
270
Given two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100".求数字字符串的二进制和。同之前的数组代表数字,两个数组相加一样。仅仅只是进位变成了2.可能两个...
分类:
其他好文 时间:
2015-07-15 22:33:49
阅读次数:
113
【比赛链接】click here~~
A. Lala Land and Apple Trees:
【题意】:
AMR住在拉拉土地。拉拉土地是一个非常美丽的国家,位于坐标线。拉拉土地是与著名的苹果树越来越随处可见。
拉拉土地恰好n苹果树。树数i位于位置xi和具有人工智能的苹果就可以了增长。阿姆鲁希望从苹果树收集苹果。 AMR目前维持在X =0的位置。在开始的时候,他可以选择是否去左边或右...
分类:
其他好文 时间:
2015-07-15 21:03:20
阅读次数:
171
A. Lala Land and Apple Trees
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Amr lives in Lala Land. Lala La...
分类:
移动开发 时间:
2015-07-15 19:19:18
阅读次数:
323
Given a binary search tree, write a functionkthSmallestto find thekth smallest element in it.Note:You may assume k is always valid, 1 ≤ k ≤ BST's tota...
分类:
其他好文 时间:
2015-07-15 18:33:34
阅读次数:
80
Problem Definition: Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. According to the definiti.....
分类:
其他好文 时间:
2015-07-15 18:21:31
阅读次数:
85
Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.According to thedefinition of LCA on Wikipedia: “The lowest ...
分类:
其他好文 时间:
2015-07-15 16:48:19
阅读次数:
94