Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According to the definition of LCA on Wikipedia: “The lowes ...
分类:
其他好文 时间:
2018-09-21 00:34:31
阅读次数:
235
The lowest common ancestor (LCA) of two nodes U and V in a tree is the deepest node that has both U and V as descendants. Given any two nodes in a bin ...
分类:
其他好文 时间:
2018-09-20 23:29:28
阅读次数:
516
提纲: 1、特性和功能讲解; 2、下载和安装; 3、启动方式; 4、界面介绍; 5、使用方法。 一、 二、jmeter的下载和安装。 在官方网站http://jmter,apache.org/选择download Releases --点击下载Binary:apache-jmter-2.7.zip( ...
分类:
其他好文 时间:
2018-09-20 13:10:03
阅读次数:
190
1 class Solution { 2 public TreeNode buildTree(int[] inorder, int[] postorder) { 3 return helper(postorder.length-1, 0, inorder.length - 1, inorder, p... ...
分类:
其他好文 时间:
2018-09-20 11:28:23
阅读次数:
106
1 //New 用一个记录queue.size()就可以 2 class Solution { 3 public List> zigzagLevelOrder(TreeNode root) { 4 List> res = new ArrayList(); 5 if(root == null) ret... ...
分类:
其他好文 时间:
2018-09-20 11:21:15
阅读次数:
100
1 class Solution { 2 public List> levelOrderBottom(TreeNode root) { 3 Queue queue = new LinkedList(); 4 List> res = new ArrayList(); 5 if(root == null... ...
分类:
其他好文 时间:
2018-09-20 11:10:18
阅读次数:
99
The gray code is a binary numeral system where two successive values differ in only one bit. Given a non-negative integer n representing the total num ...
分类:
其他好文 时间:
2018-09-20 11:08:46
阅读次数:
177
1 class Solution { 2 public TreeNode sortedArrayToBST(int[] nums) { 3 int size = nums.length; 4 return helper(nums, 0, size - 1); 5 6 } 7 8 public Tr.... ...
分类:
其他好文 时间:
2018-09-20 11:08:18
阅读次数:
127
Hdu5921 Binary Indexed Tree 思路 计数问题,题目重点在于二进制下1的次数的统计,很多题解用了数位DP来辅助计算,定义g(i)表示i的二进制中1的个数, $ans = \sum_{i=1}^n \sum_{j=0}^{i 1} g(i,j) = 0.5\sum_{i=0}^ ...
分类:
其他好文 时间:
2018-09-20 00:56:13
阅读次数:
206
# [sshw](https://github.com/yinheli/sshw)[](https://travis-ci.org/yinheli/sshw)ss... ...
分类:
系统相关 时间:
2018-09-18 23:55:45
阅读次数:
858