摘要: Binary Tree Postorder TraversalGiven a binary tree, return thepostordertraversal of its nodes' values.ExampleGiven binary tree{1,#,2,3}, 1 \ ... 阅读全文
posted @ 2015-11-05 03:01 Tri_tri_tri 阅读(386) 评论(0) 推荐(0)
摘要: 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 ... 阅读全文
posted @ 2015-11-05 01:25 Tri_tri_tri 阅读(202) 评论(0) 推荐(0)
摘要: Minimum Depth of Binary TreeGiven a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root... 阅读全文
posted @ 2015-11-04 23:22 Tri_tri_tri 阅读(103) 评论(0) 推荐(0)
摘要: 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... 阅读全文
posted @ 2015-11-04 12:17 Tri_tri_tri 阅读(152) 评论(0) 推荐(0)
摘要: Search a 2D MatrixWrite an efficient algorithm that searches for a value in anmxnmatrix.This matrix has the following properties:Integers in each row ... 阅读全文
posted @ 2015-10-30 07:07 Tri_tri_tri 阅读(199) 评论(0) 推荐(0)
摘要: Topological SortingGiven an directed graph, a topological order of the graph nodes is defined as follow:For each directed edgeA -> Bin graph, A must b... 阅读全文
posted @ 2015-10-30 02:07 Tri_tri_tri 阅读(203) 评论(0) 推荐(0)
摘要: Clone GraphClone an undirected graph. Each node in the graph contains alabeland a list of itsneighbors.OJ's undirected graph serialization:Nodes are l... 阅读全文
posted @ 2015-10-29 10:55 Tri_tri_tri 阅读(205) 评论(0) 推荐(0)
摘要: Permutations IIGiven a list of numbers with duplicate number in it. Find alluniquepermutations.ExampleFor numbers[1,2,2]the unique permutations are:[ ... 阅读全文
posted @ 2015-10-28 23:47 Tri_tri_tri 阅读(161) 评论(0) 推荐(0)
摘要: PermutationsGiven a list of numbers, return all possible permutations.ExampleFor nums =[1,2,3], the permutations are:[ [1,2,3], [1,3,2], [2,1,3], ... 阅读全文
posted @ 2015-10-28 23:12 Tri_tri_tri 阅读(260) 评论(0) 推荐(0)
摘要: Subsets IIGiven a list of numbers that may has duplicate numbers, return all possible subsetsExampleIfS=[1,2,2], a solution is:[ [2], [1], [1,2,2],... 阅读全文
posted @ 2015-10-28 23:02 Tri_tri_tri 阅读(133) 评论(0) 推荐(0)