Validate Binary Search Tree
Total Accepted: 23828 Total
Submissions: 91943My Submissions
Given a binary tree, determine if it is a valid binary search tree (BST).
Assume a BST is defined...
分类:
其他好文 时间:
2014-10-12 17:40:38
阅读次数:
180
观察文件类型statfile: ASCII data binary 或者有没有用到动态函式库type-t显示他的意义 file. alias. builtin内建-a列出PATH中-p显示外部指令的完整文件名档案特殊权限: id(列出自己信息)在原来改权限3个数字之前再加一个1个数字 chmod n...
分类:
系统相关 时间:
2014-10-12 11:14:07
阅读次数:
228
/** * Definition for binary tree * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; ...
分类:
其他好文 时间:
2014-10-12 07:47:07
阅读次数:
168
456789101112131415161718192021// Return #nodes that matches P or Q in the subtree.int countMatchesPQ(Node *root, Node *p, Node *q) { if (!root) retur....
分类:
其他好文 时间:
2014-10-12 06:40:37
阅读次数:
160
Convert Sorted List to Binary Search Tree
Total Accepted: 21420 Total
Submissions: 78476My Submissions
Given a singly linked list where elements are sorted in ascending order, convert it ...
分类:
其他好文 时间:
2014-10-12 00:00:36
阅读次数:
250
题目:Binary Tree Preorder Traversal二叉树的前序遍历,同样使用栈来解,代码如下: 1 struct TreeNode { 2 int val; 3 TreeNode* left; 4 TreeNode* righ...
分类:
其他好文 时间:
2014-10-11 22:44:56
阅读次数:
222
题目:Binary Tree Inorder Traversal二叉树的中序遍历,和前序、中序一样的处理方式,代码见下: 1 struct TreeNode { 2 int val; 3 TreeNode* left; 4 TreeNode* ...
分类:
其他好文 时间:
2014-10-11 22:03:26
阅读次数:
233
Flatten Binary Tree to Linked List
Total Accepted: 25034 Total
Submissions: 88947My Submissions
Given a binary tree, flatten it to a linked list in-place.
For example,
Given
1...
分类:
其他好文 时间:
2014-10-11 20:54:36
阅读次数:
214
Minimum Depth of Binary Tree
Total Accepted: 25609 Total
Submissions: 86491My Submissions
Given a binary tree, find its minimum depth.
The minimum depth is the number of nodes along the ...
分类:
其他好文 时间:
2014-10-11 17:41:25
阅读次数:
151
Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.
class Solution {
public:
int largestRectangleArea(int* height, int length) {
...
分类:
其他好文 时间:
2014-10-11 17:37:26
阅读次数:
156