上一页 1 2 3 4 5 6 7 8 ··· 27 下一页
摘要: Majority Element IIGiven an integer array of sizen, find all elements that appear more than⌊ n/3 ⌋times. The algorithm should run in linear time and i... 阅读全文
posted @ 2015-07-08 18:04 陆草纯 阅读(471) 评论(0) 推荐(0) 编辑
摘要: Kth Smallest Element in a BSTGiven a binary search tree, write a functionkthSmallestto find thekth smallest element in it.Note:You may assume k is alw... 阅读全文
posted @ 2015-07-08 10:45 陆草纯 阅读(327) 评论(0) 推荐(0) 编辑
摘要: Power of TwoGiven an integer, write a function to determine if it is a power of two.Credits:Special thanks to@jianchao.li.fighterfor adding this probl... 阅读全文
posted @ 2015-07-08 09:49 陆草纯 阅读(270) 评论(0) 推荐(0) 编辑
摘要: Implement Queue using StacksImplement the following operations of a queue using stacks.push(x) -- Push element x to the back of queue.pop() -- Removes... 阅读全文
posted @ 2015-07-07 21:43 陆草纯 阅读(1334) 评论(0) 推荐(0) 编辑
摘要: Contains Duplicate IIGiven an array of integers and an integerk, find out whether there there are two distinct indicesiandjin the array such thatnums[... 阅读全文
posted @ 2015-07-07 20:08 陆草纯 阅读(365) 评论(1) 推荐(0) 编辑
摘要: Contains DuplicateGiven an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at leas... 阅读全文
posted @ 2015-07-07 17:26 陆草纯 阅读(837) 评论(0) 推荐(0) 编辑
摘要: Combination Sum IIIFind all possible combinations ofknumbers that add up to a numbern, given that only numbers from 1 to 9 can be used and each combin... 阅读全文
posted @ 2015-07-07 17:06 陆草纯 阅读(287) 评论(0) 推荐(0) 编辑
摘要: Kth Largest Element in an ArrayFind thekth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the ... 阅读全文
posted @ 2015-07-07 16:07 陆草纯 阅读(230) 评论(0) 推荐(0) 编辑
摘要: Shortest PalindromeGiven a string S, you are allowed to convert it to a palindrome by adding characters in front of it. Find and return the shortest p... 阅读全文
posted @ 2015-07-04 22:04 陆草纯 阅读(2919) 评论(3) 推荐(0) 编辑
摘要: House Robber IINote:This is an extension ofHouse Robber.After robbing those houses on that street, the thief has found himself a new place for his thi... 阅读全文
posted @ 2015-07-03 17:22 陆草纯 阅读(342) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 27 下一页