摘要: 题目:(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 阅读(88) 评论(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 阅读(117) 评论(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 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 二分法的题,题目一般是在一个有序或者有序打乱的array里找一个target,或者在array里找一个数。这种题型的解题方式可以提炼出来一个套路,如下: int low = 0 ; int high = num.length-1 ; int mid = 0 ; ... 阅读全文
posted @ 2014-12-31 02:23 fengmang 阅读(279) 评论(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 阅读(206) 评论(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 阅读(143) 评论(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 阅读(136) 评论(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 阅读(152) 评论(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 阅读(115) 评论(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 阅读(109) 评论(0) 推荐(0) 编辑