As the title described, you should only use two stacks to implement a queue's actions. The queue should support push(element), pop() and top() where p ...
分类:
其他好文 时间:
2016-07-19 09:34:08
阅读次数:
99
Implement pow(x, n). Notice You don't need to care about the precision of your answer, it's acceptable if the expected answer and your answer 's diffe ...
分类:
其他好文 时间:
2016-07-18 02:31:51
阅读次数:
203
一天一道LeetCode
本系列文章已全部上传至我的github,地址:ZeeCoder‘s Github
欢迎大家关注我的新浪微博,我的新浪微博
欢迎转载,转载请注明出处
(一)题目
Implement the following operations of a queue using stacks.
push(x) – Push element x to th...
分类:
其他好文 时间:
2016-07-17 00:24:22
阅读次数:
170
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set. get(key) - Get the ...
分类:
系统相关 时间:
2016-07-16 00:34:18
阅读次数:
245
错误原因 :是因为class继承了其他的类,没有导入过来,选择add unimplemented methods进行解决 ...
分类:
编程语言 时间:
2016-07-15 19:59:52
阅读次数:
1211
Factory is a design pattern in common usage. Implement a ShapeFactory that can generate correct shape. You can assume that we have only tree different ...
分类:
其他好文 时间:
2016-07-12 07:52:17
阅读次数:
157
针对C风格的字符串(char p[n];): 长度(strlen)、追加(strcat, strncat)、比较(strcmp, strncmp)、查找(strchr, strstr)等。 --带n的版本,是有限操作,而非全部操作。例如strcmp 是对比两个字符串,而strncmp 则是对比两个字 ...
分类:
其他好文 时间:
2016-07-10 21:13:23
阅读次数:
116
Implement int sqrt(int x). Compute and return the square root of x. Have you met this question in a real interview? Yes Implement int sqrt(int x). Com ...
分类:
其他好文 时间:
2016-07-10 14:00:52
阅读次数:
123
str.capitalize() 首字母大写,其他小写 str.center(width[, fillchar]) Return centered in a string of length width. Padding is done using the specified fillchar(de ...
分类:
编程语言 时间:
2016-07-09 12:06:41
阅读次数:
209