Reverse bits of a given 32 bits unsigned integer. For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), retur...
分类:
其他好文 时间:
2015-11-06 09:37:40
阅读次数:
140
题目:Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.According to thedefinition of LCA on Wikipedi...
分类:
其他好文 时间:
2015-11-05 10:32:12
阅读次数:
134
QuestionGiven a binary tree containing digits from0-9only, each root-to-leaf path could represent a number.An example is the root-to-leaf path1->2->3w...
分类:
其他好文 时间:
2015-11-05 10:27:11
阅读次数:
217
Insert Node in a Binary Search TreeGiven a binary search tree and a new tree node, insert the node into the tree. You should keep the tree still be a ...
分类:
其他好文 时间:
2015-11-05 06:11:40
阅读次数:
195
package cn.edu.xidian.sselab;/*** title:Add Binary* content:* Given two binary strings, return their sum (also a binary string).* For example;* a = "1...
分类:
其他好文 时间:
2015-11-04 22:57:36
阅读次数:
176
package cn.edu.xidian.sselab;/*** title:Same Tree* content:* Given two binary trees, write a function to check if they are equal or not.* Two binary t...
分类:
其他好文 时间:
2015-11-04 22:52:04
阅读次数:
212
题意: 寻找一棵BST中的第k小的数。思路: 递归比较方便。 1 /** 2 * Definition for a binary tree node. 3 * struct TreeNode { 4 * int val; 5 * TreeNode *left; 6 * ...
分类:
其他好文 时间:
2015-11-04 21:04:21
阅读次数:
296
Scenario Master – Master replication MasterA is a client facing server MasterB is a warm standby server (read only) MasterB restarted abruptly and when instances were braught back up MasterA (it’...
分类:
其他好文 时间:
2015-11-04 15:00:34
阅读次数:
187
Binary Search Tree IteratorDesign an iterator over a binary search tree with the following rules:Elements are visited in ascending order (i.e. an in-o...
分类:
其他好文 时间:
2015-11-04 13:05:55
阅读次数:
165
原题链接在这里:https://leetcode.com/problems/serialize-and-deserialize-binary-tree/把一个树serialize 和 deserialize. 递归方法是通过pre-order来serialize. 1 / \ 2 3...
分类:
其他好文 时间:
2015-11-04 07:03:55
阅读次数:
332