摘要:
ref http://blog.csdn.net/u013325815/article/details/41892135The API:int read4(char *buf)reads 4 characters at a time from a file.The return value is t... 阅读全文
摘要:
Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complete a... 阅读全文
摘要:
Given an input string, reverse the string word by word. A word is defined as a sequence of non-space characters.The input string does not contain lead... 阅读全文
摘要:
Given a list of non negative integers, arrange them such that they form the largest number.For example, given[3, 30, 34, 5, 9], the largest formed num... 阅读全文
摘要:
The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists of M x N rooms laid out in a... 阅读全文
摘要:
完全没有想法实际上是in order traversal而已public class BSTIterator { public TreeNode crt; public Stack st = new Stack(); public BSTIterator(TreeNode ... 阅读全文
摘要:
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations:getandset.get(key)- Get the valu... 阅读全文
摘要:
Given an integern, return the number of trailing zeroes inn!.ref 抄自达达http://www.danielbit.com/blog/puzzle/leetcode/leetcode-factorial-trailing-zeroes首... 阅读全文
摘要:
Related to questionExcel Sheet Column TitleGiven a column title as appear in an Excel sheet, return its corresponding column number.For example: A ... 阅读全文
摘要:
Given a positive integer, return its corresponding column title as appear in an Excel sheet.For example: 1 -> A 2 -> B 3 -> C ... 26 ->... 阅读全文