- 博客(11)
- 收藏
- 关注
原创 Contains Duplicate -- leetcode
Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should return false if every element
2015-08-24 16:14:20 463
原创 Combination Sum III -- leetcode
Find all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9 can be used and each combination should be a unique set of numbers. Ensure that numbers wi
2015-08-24 15:55:09 684
原创 Kth Largest Element in an Array -- leetcode
Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element. For example, Given [3,2,1,5,6,4] and k = 2, return 5.
2015-08-20 18:04:59 481
原创 Shortest Palindrome -- leetcode
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 find by performing this transformation. For exam
2015-08-19 11:08:25 429
原创 House Robber II -- leetcode
Note: This is an extension of House Robber. 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 time
2015-08-16 15:12:50 543
原创 Add and Search Word - Data structure design -- leetcode
Design a data structure that supports the following two operations: void addWord(word) bool search(word) search(word) can search a literal word or a regular expression string containing only letter
2015-08-09 11:31:51 626
原创 Course Schedule II -- leetcode
There are a total of n courses you have to take, labeled from 0 to n - 1. Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as
2015-08-08 19:20:25 453
原创 Minimum Size Subarray Sum -- leetcode
Given an array of n positive integers and a positive integer s, find the minimal length of a subarray of which the sum ≥ s. If there isn't one, return 0 instead. For example, given the array [2,3
2015-08-08 10:27:46 438
转载 Linux下的多线程编程
作者:gnuhpc 出处:http://www.cnblogs.com/gnuhpc/ 本文作者: 姚继锋 (2001-08-11 09:05:00) 黄鹏程(2009-03-13) converse (2009-01-15) 1 引言 线程(thread)技术早在60年代就被提出,但真正应用多线程到操作系统中去,是在80年代中期,solaris是这方面的佼佼者。传统的 Unix也支
2015-08-06 08:55:55 518
原创 Implement Trie (Prefix Tree) -- leetcode
Implement a trie with insert, search, and startsWith methods. Note: You may assume that all inputs are consist of lowercase letters a-z. 基本思路, 作一个26叉树。 本来想作一个27叉,用额外一叉,表示字符串的结束字符('\0'). 但
2015-08-02 19:28:06 466
原创 Course Schedule -- leetcode
There are a total of n courses you have to take, labeled from 0 to n - 1. Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as
2015-08-02 16:04:01 445
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人