今早起来做 LeetCode,结果被这道题卡了将近1个半小时,忍着没有去搜答案,最后还是被我想出来了,而且直接一次AC,哈哈!现在在这里记录一下解题思路。原题:Givenn, generate all structurally uniqueBST's(binary search trees) t.....
分类:
其他好文 时间:
2014-10-24 15:57:21
阅读次数:
202
示例数据表: CREATE?TABLE?test_bin?(
???bin_id?BINARY(16)?NOT?NULL
)?Engine=InnoDB; 插入数据(内容是一个32位的UUID字符串值): INSERT?INTO?test_bin(bin_id)?VALUES(UNHEX(‘FA34E10293CB428...
分类:
数据库 时间:
2014-10-24 13:10:00
阅读次数:
3565
Suppose a sorted array is rotated at some pivot unknown to you beforehand.
(i.e., 0 1 2 4 5 6 7 might become 4
5 6 7 0 1 2).
Find the minimum element.
You may assume no duplicate exists in...
分类:
其他好文 时间:
2014-10-24 13:06:25
阅读次数:
224
题目描述:
Given a binary tree, find its maximum depth.
The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.
解题思路:直接DFS。
代码:
/**...
分类:
其他好文 时间:
2014-10-24 13:04:21
阅读次数:
147
问题描述:
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-10-24 13:03:03
阅读次数:
148
Given two binary strings, return their sum (also a binary string).
For example,
a = "11"
b = "1"
Return "100".
Show Tags
Have you been asked this question in an interview?
...
分类:
其他好文 时间:
2014-10-23 17:47:23
阅读次数:
229
keyhash是由keystore产生的三个命令解决问题keytool -exportcert -alias androiddebugkey -keystore debug.keystore > debug.txt输入密码:openssl sha1 -binary debug.txt > debu....
分类:
其他好文 时间:
2014-10-23 17:38:46
阅读次数:
149
Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth...
分类:
其他好文 时间:
2014-10-23 15:39:15
阅读次数:
149
FIO14-C. Understand the difference between text mode and binary mode with file streamsSkip to end of metadataCreated byJustin Pincar, last modified by...
分类:
其他好文 时间:
2014-10-23 12:18:04
阅读次数:
243
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 an...
分类:
其他好文 时间:
2014-10-23 11:56:21
阅读次数:
221