随笔分类 -  [LeetCode]

上一页 1 ··· 3 4 5 6 7 8 下一页
摘要:The problem:Given a collection of intervals, merge all overlapping intervals.For example,Given[1,3],[2,6],[8,10],[15,18],return[1,6],[8,10],[15,18].My... 阅读全文
posted @ 2015-01-15 00:23 airforce 阅读(137) 评论(0) 推荐(0)
摘要:---恢复内容开始---The problem:Given two words (startandend), and a dictionary, find the length of shortest transformation sequence fromstarttoend, such that... 阅读全文
posted @ 2015-01-13 02:02 airforce 阅读(149) 评论(0) 推荐(0)
摘要:The problem:Clone an undirected graph. Each node in the graph contains alabeland a list of itsneighbors.OJ's undirected graph serialization:Nodes are ... 阅读全文
posted @ 2015-01-12 23:33 airforce 阅读(237) 评论(0) 推荐(0)
摘要:The problem:Given a binary tree, return thezigzag level ordertraversal of its nodes' values. (ie, from left to right, then right to left for the next ... 阅读全文
posted @ 2015-01-12 00:57 airforce 阅读(134) 评论(0) 推荐(0)
摘要:The problem:Given a binary tree, return thelevel ordertraversal of its nodes' values. (ie, from left to right, level by level).For example:Given binar... 阅读全文
posted @ 2015-01-11 12:15 airforce 阅读(161) 评论(0) 推荐(0)
摘要:The problem:Given a binary tree, return thepostordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3retu... 阅读全文
posted @ 2015-01-11 11:07 airforce 阅读(174) 评论(0) 推荐(0)
摘要:The problem:Given a binary tree, return thepreordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3retur... 阅读全文
posted @ 2015-01-11 09:50 airforce 阅读(150) 评论(0) 推荐(0)
摘要:The problem:Given a binary tree, return thepreordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3retur... 阅读全文
posted @ 2015-01-11 09:49 airforce 阅读(171) 评论(0) 推荐(0)
摘要:The problem:Given a binary tree, return theinordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return... 阅读全文
posted @ 2015-01-11 04:15 airforce 阅读(131) 评论(0) 推荐(0)
摘要:The problem:Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally ... 阅读全文
posted @ 2015-01-11 02:03 airforce 阅读(135) 评论(0) 推荐(0)
摘要:The problem 1:Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to t... 阅读全文
posted @ 2015-01-11 01:31 airforce 阅读(147) 评论(0) 推荐(0)
摘要:The problem:Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the below binary tree,... 阅读全文
posted @ 2015-01-11 00:02 airforce 阅读(169) 评论(0) 推荐(0)
摘要:The problem:Given 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... 阅读全文
posted @ 2015-01-10 12:01 airforce 阅读(181) 评论(0) 推荐(0)
摘要:Problem 1 [Balanced Binary Tree]Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as ... 阅读全文
posted @ 2015-01-10 04:39 airforce 阅读(182) 评论(0) 推荐(0)
摘要:The problem:Given a string containing only digits, restore it by returning all possible valid IP address combinations.For example:Given"25525511135",r... 阅读全文
posted @ 2015-01-10 00:20 airforce 阅读(214) 评论(0) 推荐(0)
摘要:The problem:Givenn, generate all structurally uniqueBST's(binary search trees) that store values 1...n.My analysis:The problem is easy at some extent,... 阅读全文
posted @ 2015-01-09 11:10 airforce 阅读(219) 评论(0) 推荐(0)
摘要:The problem:Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A solution using O(... 阅读全文
posted @ 2015-01-09 01:30 airforce 阅读(119) 评论(0) 推荐(0)
摘要:The problem:Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node con... 阅读全文
posted @ 2015-01-08 23:44 airforce 阅读(348) 评论(0) 推荐(0)
摘要:The problem:Given inorder and postorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.My... 阅读全文
posted @ 2015-01-08 11:59 airforce 阅读(189) 评论(0) 推荐(0)
摘要:The problem:Given preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.My ... 阅读全文
posted @ 2015-01-08 10:53 airforce 阅读(156) 评论(0) 推荐(0)

上一页 1 ··· 3 4 5 6 7 8 下一页