摘要: Given a binary tree, find the subtree with minimum sum. Return the root of the subtree. Notice LintCode will print the subtree which root is your retu 阅读全文
posted @ 2017-10-08 12:49 jasminemzy 阅读(129) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find the subtree with maximum average. Return the root of the subtree. Notice LintCode will print the subtree which root is your 阅读全文
posted @ 2017-10-08 08:46 jasminemzy 阅读(162) 评论(0) 推荐(0) 编辑
摘要: Given an array with positive and negative numbers, find the maximum average subarray which length should be greater or equal to given length k. Notice 阅读全文
posted @ 2017-10-08 08:39 jasminemzy 阅读(247) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the preoder, inorder, postorder traversal of its nodes' values. 模板对 ArrayList<Integer> result + Stack<TreeNode> stack 好基友 阅读全文
posted @ 2017-10-03 03:42 jasminemzy 阅读(308) 评论(0) 推荐(0) 编辑
摘要: Implement double sqrt(double x) and x >= 0. Compute and return the square root of x. Notice You do not care about the accuracy of the result, we will 阅读全文
posted @ 2017-09-27 05:13 jasminemzy 阅读(185) 评论(0) 推荐(0) 编辑
摘要: Implement int sqrt(int x). Compute and return the square root of x. Example sqrt(3) = 1 sqrt(4) = 2 sqrt(5) = 2 sqrt(10) = 3 sqrt(3) = 1 sqrt(4) = 2 s 阅读全文
posted @ 2017-09-26 13:14 jasminemzy 阅读(108) 评论(0) 推荐(0) 编辑
摘要: Given a sorted array of n integers, find the starting and ending position of a given target value. If the target is not found in the array, return [-1 阅读全文
posted @ 2017-09-26 07:57 jasminemzy 阅读(125) 评论(0) 推荐(0) 编辑
摘要: Divide two integers without using multiplication, division and mod operator. If it is overflow, return 2147483647 Example Given dividend = 100 and div 阅读全文
posted @ 2017-09-26 07:18 jasminemzy 阅读(178) 评论(0) 推荐(0) 编辑
摘要: For a given sorted array (ascending order) and a target number, find the first index of this number in O(log n) time complexity. If the target number 阅读全文
posted @ 2017-09-26 03:24 jasminemzy 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Given a target number, a non-negative integer k and an integer array A sorted in ascending order, find the k closest numbers to target in A, sorted in 阅读全文
posted @ 2017-09-26 03:19 jasminemzy 阅读(181) 评论(0) 推荐(0) 编辑