上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 30 下一页
摘要: Design an algorithm and write code to serialize and deserialize a binary tree. Writing the tree to a file is called 'serialization' and reading back f... 阅读全文
posted @ 2015-05-25 18:16 Eason Liu 阅读(581) 评论(0) 推荐(0) 编辑
摘要: Givennpoints on a 2D plane, find the maximum number of points that lie on the same straight line.经过同一个点且斜率相等的直线一定是同一条直线,所以我们只要分别计算每一个点与其它点的直线的斜率,统计斜率的... 阅读全文
posted @ 2015-05-25 14:32 Eason Liu 阅读(207) 评论(0) 推荐(0) 编辑
摘要: Find all possible combinations ofknumbers that add up to a numbern, given that only numbers from 1 to 9 can be used and each combination should be a u... 阅读全文
posted @ 2015-05-24 11:54 Eason Liu 阅读(999) 评论(1) 推荐(0) 编辑
摘要: There are n coins with different value in a line. Two players take turns to take one or two coins from left side until there are no more coins left. T... 阅读全文
posted @ 2015-05-23 23:47 Eason Liu 阅读(2238) 评论(0) 推荐(0) 编辑
摘要: Find thekth largest element in an unsorted array.For example,Given[3,2,1,5,6,4]and k = 2, return 5.Note:You may assume k is always valid, 1 ≤ k ≤ arra... 阅读全文
posted @ 2015-05-23 12:06 Eason Liu 阅读(4918) 评论(3) 推荐(0) 编辑
摘要: Given a string S, you are allowed to convert it to a palindrome by adding characters in front of it. Find and return the shortest palindrome you can f... 阅读全文
posted @ 2015-05-22 16:41 Eason Liu 阅读(3422) 评论(0) 推荐(0) 编辑
摘要: After robbing those houses on that street, the thief has found himself a new place for his thievery so that he will not get too much attention. This t... 阅读全文
posted @ 2015-05-20 10:43 Eason Liu 阅读(3407) 评论(2) 推荐(0) 编辑
摘要: Given a 2D board and a list of words from the dictionary, find all words in the board.Each word must be constructed from letters of sequentially adjac... 阅读全文
posted @ 2015-05-19 11:31 Eason Liu 阅读(4627) 评论(0) 推荐(0) 编辑
摘要: There is an integer matrix which has the following features:The numbers in adjacent positions are different.The matrix has n rows and m columns.For al... 阅读全文
posted @ 2015-05-17 13:03 Eason Liu 阅读(2612) 评论(3) 推荐(0) 编辑
摘要: Given n distinct positive integers, integer k (k A, int k, int target) {11 // wirte your code here12 vector > dp(k + 1, vector(target... 阅读全文
posted @ 2015-05-16 17:25 Eason Liu 阅读(1080) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 30 下一页