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-02 09:53:05
阅读次数:
128
LeetCode_Binary Tree Maximum Path Sum 解题思路...
分类:
其他好文 时间:
2015-07-01 23:43:24
阅读次数:
242
Following are some general papers about ABI and EABI.
Entrance
https://en.wikipedia.org/wiki/Application_binary_interface
PowerPc Embedded Application Binary Interface (EABI) : 32...
分类:
其他好文 时间:
2015-07-01 18:16:05
阅读次数:
130
"String or binary data would be truncated. The statement has been terminated" most probably means that the size ofvalue you want to insert is larger t...
分类:
其他好文 时间:
2015-07-01 17:50:03
阅读次数:
128
前序:
class Solution {
public:
/**
* @param root: The root of binary tree.
* @return: Preorder in vector which contains node values.
*/
vector preorderTraversal(TreeNode *root) {...
分类:
其他好文 时间:
2015-07-01 16:06:10
阅读次数:
173
题目:Invert Binary TreeInvert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1解答:# Definition fo...
分类:
其他好文 时间:
2015-07-01 11:39:21
阅读次数:
98
50 Pow(x, n)链接:https://leetcode.com/problems/powx-n/
问题描述:
Implement pow(x, n).Hide Tags Math Binary Search实现pow函数。这个问题可以用递归解决,联想到到 Binary Search,我的解决方案是每次让指数缩小两倍,当指数为技术的时候需要特别处理。还有指数为负的情况需要注意。class...
分类:
其他好文 时间:
2015-07-01 10:12:27
阅读次数:
104
题意:给出n棵树,给出横坐标x,还有它们的高度h,先按照横坐标排序,则它们的横坐标记为xx,再按照它们的高度排序,记为hh两颗树的差异度为 abs(xx[i] - xx[j]) * min(hh[i],hh[j]),求所有的差异度的和和上面一道题一样,只不过这题是要Min的值,就将h从大到小排序,保...
分类:
编程语言 时间:
2015-06-30 14:43:35
阅读次数:
133
21) Redis 简介Redis 是一个开源的使用 ANSI C 语言编写、支持网络、可基于内存亦可持久化的日志型、Key-Value 数据库。2) 数据类型2.1. Redis 的 KeyRedis 的 key 是字符串类型,但是 key 中不能包括边界字符,由于 key 不是 binary s...
分类:
其他好文 时间:
2015-06-30 14:22:56
阅读次数:
87
LeetCode_Minimum Depth of Binary Tree 解题思路...
分类:
其他好文 时间:
2015-06-30 12:59:11
阅读次数:
93