LeetCode --- 211. Add and Search Word - Data structure design May 25, 2015

 Tags LeetCode , C++ , 回溯 , 数据结构 , 字典树

题目链接:Add and Search Word - Data structure designDesign a data structure that supports the following two operations:void addWord(word) bool search(word) search(word) ca... More »

0条评论

LeetCode --- 210. Course Schedule II May 14, 2015

 Tags LeetCode , C++ , 深度优先搜索 , 广度优先搜索 , , 拓扑排序

题目链接:Course Schedule IIThere 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 h... More »

0条评论

LeetCode --- 209. Minimum Size Subarray Sum May 14, 2015

 Tags LeetCode , C++ , 数组 , 双指针 , 二分搜索

题目链接:Minimum Size Subarray SumGiven 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’... More »

0条评论

LeetCode --- 208. Implement Trie (Prefix Tree) May 9, 2015

 Tags LeetCode , C++ , 数据结构 , 字典树

题目链接:Implement Trie (Prefix Tree)Implement a trie with insert, search, and startsWith methods.Note:You may assume that all inputs are consist of lowercase letters a-z.... More »

0条评论

LeetCode --- 207. Course Schedule May 9, 2015

 Tags LeetCode , C++ , 深度优先搜索 , 广度优先搜索 , , 拓扑排序

题目链接:Course ScheduleThere 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... More »

0条评论

LeetCode --- 206. Reverse Linked List May 5, 2015

 Tags LeetCode , C++ , Hash表

题目链接:Reverse Linked ListReverse a singly linked list.Hint:A linked list can be reversed either iteratively or recursively. Could you implement both?这道题的要求是反转链表。 迭... More »

0条评论

LeetCode --- 205. Isomorphic Strings May 4, 2015

 Tags LeetCode , C++ , Hash表

题目链接:Isomorphic StringsGiven two strings s and t, determine if they are isomorphic.Two strings are isomorphic if the characters in s can be replaced to get t.All occur... More »

0条评论

LeetCode --- 204. Count Primes May 4, 2015

 Tags LeetCode , C++ , Hash表 , 数学

题目链接:Count PrimesDescription:Count the number of prime numbers less than a non-negative number, n.References:How Many Primes Are There?Sieve of Eratosthenes这道题的要求是统计小于... More »

0条评论

LeetCode --- 203. Remove Linked List Elements May 3, 2015

 Tags LeetCode , C++ , 链表

题目链接:Remove Linked List ElementsRemove all elements from a linked list of integers that have value val.Example:Given: 1 –> 2 –> 6 –> 3 –> 4 –> 5 –> 6... More »

0条评论

LeetCode --- 202. Happy Number May 3, 2015

 Tags LeetCode , C++ , Hash表 , 数学

题目链接:Happy NumberWrite an algorithm to determine if a number is “happy”.A happy number is a number defined by the following process: Starting with any positive integer... More »

0条评论