lintcode
文章平均质量分 76
oldsui
这个作者很懒,什么都没留下…
展开
-
20150624 lintcode 总结 Validate Binary Search Tree
Validate Binary Search Tree题目:http://www.lintcode.com/en/problem/validate-binary-search-tree/Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is de原创 2015-06-24 00:11:56 · 542 阅读 · 0 评论 -
Maximum Subarray Difference Solution
这道题感觉非常有意思,值得记录一下。思路来源:https://codesolutiony.wordpress.com/2015/05/28/lintcode-maximum-subarray-difference/public class Solution { /** * @param nums: A list of integers * @return:原创 2015-10-22 17:39:35 · 338 阅读 · 0 评论 -
20150707 lintcode 总结 Search Range in Binary Search Tree
Given two values k1 and k2 (where k1 ExampleIf k1 = 10 and k2 = 22, then your function should return [12, 20, 22]. 20 / \ 8 22 / \4 12/** * Definition of TreeNo原创 2015-07-07 12:02:42 · 494 阅读 · 0 评论 -
20150708 lintcode 总结 Binary Tree Maximum Path Sum Show result *****
Medium Binary Tree Maximum Path SumShow result 23%AcceptedGiven a binary tree, find the maximum path sum. The path may start and end at any node in the tree.Example: Given th原创 2015-07-08 16:23:48 · 418 阅读 · 0 评论 -
20150708 lintcode 总结 Minimum Path Sum
Easy Minimum Path SumShow result 34%AcceptedGiven a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numb原创 2015-07-08 15:09:06 · 379 阅读 · 0 评论 -
20150708 lintcode 总结 Binary Search Tree Iterator
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-order traversal)next() and hasNext(原创 2015-07-08 11:09:18 · 623 阅读 · 0 评论 -
20150624 lintcode 总结 binary-tree-level-order-traversal **
Binary Tree Level Order Traversalhttp://www.lintcode.com/problem/binary-tree-level-order-traversalGiven a binary tree, return the level order traversal of its nodes' values. (ie, from原创 2015-06-24 23:59:50 · 345 阅读 · 0 评论 -
20150624 lintcode 总结 Lowest Common Ancestor
Lowest Common Ancestorhttp://www.lintcode.com/problem/lowest-common-ancestorGiven the root and two nodes in a Binary Tree. Find the lowest common ancestor(LCA) of the two nodes.T原创 2015-06-24 23:00:22 · 410 阅读 · 0 评论 -
20150624 lintcode 总结 Balanced Binary Tree
判断是否为balanced binary tree:http://www.lintcode.com/en/problem/balanced-binary-tree/Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is原创 2015-06-24 13:31:22 · 525 阅读 · 0 评论 -
Maximum Subarray III
Given an array of integers and a number k, find k non-overlapping subarrays which have the largest sum.The number in each subarray should be contiguous.ExampleGiven [-1,4,-2,3,-2,3], k原创 2015-11-11 14:47:00 · 467 阅读 · 0 评论