12 2014 档案

摘要:题目:(Tree Stack)Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.Callingnext()will ... 阅读全文
posted @ 2014-12-31 22:59 fengmang 阅读(95) 评论(0) 推荐(0)
摘要:题目:(HashTable Two Point String)Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity ... 阅读全文
posted @ 2014-12-31 06:54 fengmang 阅读(121) 评论(0) 推荐(0)
摘要:题目:(HashTable,Two Point)You are given a string,S, and a list of words,L, that are all of the same length. Find all starting indices of substring(s) in... 阅读全文
posted @ 2014-12-31 03:54 fengmang 阅读(141) 评论(0) 推荐(0)
摘要:二分法的题,题目一般是在一个有序或者有序打乱的array里找一个target,或者在array里找一个数。这种题型的解题方式可以提炼出来一个套路,如下: int low = 0 ; int high = num.length-1 ; int mid = 0 ; ... 阅读全文
posted @ 2014-12-31 02:23 fengmang 阅读(285) 评论(0) 推荐(0)
摘要:题目:(Math)Given an integern, return the number of trailing zeroes inn!.Note:Your solution should be in logarithmic time complexity.题解:首先列几个例子找一找规律。然后发现... 阅读全文
posted @ 2014-12-30 22:58 fengmang 阅读(212) 评论(0) 推荐(0)
摘要:题目:Clone an undirected graph. Each node in the graph contains alabeland a list of itsneighbors.OJ's undirected graph serialization:Nodes are labeled u... 阅读全文
posted @ 2014-12-30 03:49 fengmang 阅读(148) 评论(0) 推荐(0)
摘要:题目:(Sort)Given an unsorted array, find the maximum difference between the successive elements in its sorted form.Try to solve it in linear time/space.... 阅读全文
posted @ 2014-12-30 01:20 fengmang 阅读(141) 评论(0) 推荐(0)
摘要:题目:(Array, Sort)Given a collection of intervals, merge all overlapping intervals.For example,Given[1,3],[2,6],[8,10],[15,18],return[1,6],[8,10],[15,18... 阅读全文
posted @ 2014-12-30 01:14 fengmang 阅读(160) 评论(0) 推荐(0)
摘要:题目:(DC,LinkedList,Heap)Mergeksorted linked lists and return it as one sorted list. Analyze and describe its complexity.题解:leetcode中不多的heap题,priorityqu... 阅读全文
posted @ 2014-12-29 23:28 fengmang 阅读(119) 评论(0) 推荐(0)
摘要:题目:(DP , String)Givens1,s2,s3, find whethers3is formed by the interleaving ofs1ands2.For example,Given:s1="aabcc",s2="dbbca",Whens3="aadbbcbcac", retu... 阅读全文
posted @ 2014-12-29 07:57 fengmang 阅读(115) 评论(0) 推荐(0)
摘要:题目:(DP,BackTracking, Greedy,String)Implement wildcard pattern matching with support for'?'and'*'.'?' Matches any single character.'*' Matches any sequ... 阅读全文
posted @ 2014-12-26 23:40 fengmang 阅读(145) 评论(0) 推荐(0)
摘要:题目:(DP, String)A message containing letters fromA-Zis being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encode... 阅读全文
posted @ 2014-12-26 05:06 fengmang 阅读(133) 评论(0) 推荐(0)
摘要:题目:(Greedy)There areNchildren standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the foll... 阅读全文
posted @ 2014-12-26 02:59 fengmang 阅读(139) 评论(0) 推荐(0)
摘要:题目:(Backtracking)The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integernrepresenting... 阅读全文
posted @ 2014-12-25 23:52 fengmang 阅读(294) 评论(0) 推荐(0)
摘要:题目:(DP ,BackTracking, String)Implement regular expression matching with support for'.'and'*'.'.' Matches any single character.'*' Matches zero or more... 阅读全文
posted @ 2014-12-25 05:05 fengmang 阅读(172) 评论(0) 推荐(0)
摘要:题目:(Stack, String)Given an absolute path for a file (Unix-style), simplify it.For example,path="/home/", =>"/home"path="/a/./b/../../c/", =>"/c"click ... 阅读全文
posted @ 2014-12-25 03:48 fengmang 阅读(161) 评论(0) 推荐(0)
摘要:题目:(String)Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique... 阅读全文
posted @ 2014-12-25 02:57 fengmang 阅读(257) 评论(0) 推荐(0)
摘要:题目:(Math)Given a positive integer, return its corresponding column title as appear in an Excel sheet.For example: 1 -> A 2 -> B 3 -> C ...... 阅读全文
posted @ 2014-12-25 01:32 fengmang 阅读(115) 评论(0) 推荐(0)