摘要: Count Complete Tree NodesGiven acompletebinary tree, count the number of nodes.Definition of a complete binary tree fromWikipedia:In a complete binary... 阅读全文
posted @ 2015-06-07 12:06 `Liok 阅读(235) 评论(0) 推荐(0) 编辑
摘要: Sudoku SolverWrite a program to solve a Sudoku puzzle by filling the empty cells.Empty cells are indicated by the character'.'.You may assume that the... 阅读全文
posted @ 2015-06-06 16:43 `Liok 阅读(474) 评论(0) 推荐(0) 编辑
摘要: Letter Combinations of a Phone NumberGiven a digit string, return all possible letter combinations that the number could represent.A mapping of digit ... 阅读全文
posted @ 2015-06-05 00:06 `Liok 阅读(693) 评论(0) 推荐(0) 编辑
摘要: TriangleGiven a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given... 阅读全文
posted @ 2015-06-01 22:52 `Liok 阅读(326) 评论(0) 推荐(0) 编辑
摘要: Jump Game IIGiven an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents... 阅读全文
posted @ 2015-05-31 22:44 `Liok 阅读(415) 评论(0) 推荐(0) 编辑
摘要: ZigZag ConversionThe string"PAYPALISHIRING"is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern i... 阅读全文
posted @ 2015-05-31 18:17 `Liok 阅读(596) 评论(0) 推荐(0) 编辑
摘要: Longest Consecutive SequenceGiven an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given[100, 4... 阅读全文
posted @ 2015-05-31 17:07 `Liok 阅读(442) 评论(0) 推荐(0) 编辑
摘要: 3SumGiven an arraySofnintegers, are there elementsa,b,cinSsuch thata+b+c= 0? Find all unique triplets in the array which gives the sum of zero.Note:El... 阅读全文
posted @ 2015-05-30 20:12 `Liok 阅读(1046) 评论(0) 推荐(0) 编辑
摘要: Reverse Linked ListReverse a singly linked list.click to show more hints.Hint:A linked list can be reversed either iteratively or recursively. Could y... 阅读全文
posted @ 2015-05-30 15:43 `Liok 阅读(719) 评论(0) 推荐(0) 编辑
摘要: Contains Duplicate IIGiven an array of integers and an integer k, return true if and only if there are two distinct indices i and j in the array such ... 阅读全文
posted @ 2015-05-30 15:28 `Liok 阅读(431) 评论(2) 推荐(0) 编辑