leetcode 235: Lowest Common Ancestor of a Binary Search Tree...
分类:
其他好文 时间:
2015-07-11 07:54:07
阅读次数:
130
1.binary heap实现BinaryHeap.h#ifndef BINARYHEAP_H#define BINARYHEAP_Hclass BinaryHeap{ public: BinaryHeap(int N); bool isEmpty(); ...
分类:
其他好文 时间:
2015-07-10 22:10:53
阅读次数:
233
https://leetcode.com/problems/unique-binary-search-trees/ 1 class Solution { 2 public: 3 int numTrees(int n) { 4 //典型的动态规划问题 5 //先...
分类:
其他好文 时间:
2015-07-10 22:04:23
阅读次数:
115
Given a binary tree, return the preorder traversal of its nodes’ values.For example:
Given binary tree {1,#,2,3},
1
\
2
/
3
return [1,2,3].Note: Recursive solution is trivial,...
分类:
其他好文 时间:
2015-07-10 20:53:50
阅读次数:
123
1 #----------------------------------- 2 #1.正则表达式检索 [RegexP] 3 #----------------------------------- 4 # * Binary字段可以支持大小写匹配 5 # * 文本开始^(集合中是否定) 结束$ 6....
分类:
数据库 时间:
2015-07-10 19:01:26
阅读次数:
198
https://leetcode.com/problems/binary-tree-inorder-traversal/递归中序遍历 1 /** 2 * Definition for a binary tree node. 3 * struct TreeNode { 4 * int v...
分类:
其他好文 时间:
2015-07-10 18:21:58
阅读次数:
122
Maximum Depth of Binary Tree (DFS, TREE)Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path fr...
分类:
其他好文 时间:
2015-07-10 13:17:22
阅读次数:
99
Maximal SquareTotal Accepted:6373Total Submissions:31927My SubmissionsQuestionSolutionGiven a 2D binary matrix filled with 0's and 1's, find the large...
分类:
其他好文 时间:
2015-07-10 11:00:27
阅读次数:
99
Path Sum
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.
For example:
Given the below bina...
分类:
其他好文 时间:
2015-07-10 09:36:28
阅读次数:
113
http://acm.hdu.edu.cn/showproblem.php?pid=1710Binary Tree TraversalsTime Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Tot...
分类:
其他好文 时间:
2015-07-10 02:13:21
阅读次数:
247