摘要: 1 #include 2 #include 3 using namespace std; 4 5 template class SQueue 6 { 7 public: 8 SQueue():cnt(0){}; 9 10 void push(const T& node);1... 阅读全文
posted @ 2015-06-19 16:21 tjuloading 阅读(134) 评论(0) 推荐(0)
摘要: Given an array ofnpositive integers and a positive integers, find the minimal length of a subarray of which the sum ≥s. If there isn't one, return 0 i... 阅读全文
posted @ 2015-06-18 16:53 tjuloading 阅读(172) 评论(0) 推荐(0)
摘要: Implement a trie withinsert,search, andstartsWithmethods.Note:You may assume that all inputs are consist of lowercase lettersa-z.思路: 构建一个简单的字典树,要求实现... 阅读全文
posted @ 2015-06-18 15:52 tjuloading 阅读(136) 评论(0) 推荐(0)
摘要: This is an extension ofHouse Robber.After robbing those houses on that street, the thief has found himself a new place for his thievery so that he wil... 阅读全文
posted @ 2015-06-17 16:33 tjuloading 阅读(187) 评论(0) 推荐(0)
摘要: There are a total ofncourses you have to take, labeled from0ton - 1.Some courses may have prerequisites, for example to take course 0 you have to firs... 阅读全文
posted @ 2015-06-16 14:46 tjuloading 阅读(184) 评论(0) 推荐(0)
摘要: Find thekth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.For exampl... 阅读全文
posted @ 2015-06-16 14:02 tjuloading 阅读(262) 评论(0) 推荐(0)