实现lru 缓存
LRU Cache
Total Accepted: 35641 Total
Submissions: 241374My Submissions
Question
Solution
Design and implement a data structure for Least Recently Used (LRU) c...
分类:
系统相关 时间:
2015-04-09 17:37:34
阅读次数:
157
Continue previous article :
Understand wave format, and implement a wave reader , In here , I will demonstrate how to play audio in windows.
(Zeroth are wave format, you could refer to previous a...
给定两个字符串s1,s2,要求判定s2是否能够被s1做循环移位得到的字符串包含。例如,给定s1=AABCD和s2=CDAA,返回true;给定s1=ABCD和s2=ACBD,返回false。法一:直接循环移位,用strstr()比较 1 #include 2 #include 3 using n.....
分类:
其他好文 时间:
2015-04-08 22:49:58
阅读次数:
210
problem:
Implement int sqrt(int x).
Compute and return the square root of x.
Hide Tags
Math Binary
Search
题意:计算平方根,没有指定精度,默认精度为0.00001
thinking:
(1)由于...
分类:
其他好文 时间:
2015-04-08 10:56:36
阅读次数:
192
Implement wildcard pattern matching with support for '?' and '*'.'?' Matches any single character.'*' Matches any sequence of characters (including th...
分类:
其他好文 时间:
2015-04-08 06:33:45
阅读次数:
123
??
问题描述:
Implement
atoi to convert a string to an integer.
Hint: Carefullyconsider all possible input
cases. If you want a challenge, please do not seebelow and ask yourself what are the p...
分类:
其他好文 时间:
2015-04-07 17:41:26
阅读次数:
133
Introduction1、Learning the fundamentals of a programming language is one thing; learning how to design and implement effective programs in that langua...
分类:
编程语言 时间:
2015-04-06 23:01:55
阅读次数:
207
1.Abstractdoes force all the derived classes toimplementthemethod, but nothing forces thederivedderived classesto implement its own DrawWindow() metho...
分类:
其他好文 时间:
2015-04-06 20:08:39
阅读次数:
99
Delegate是把一个类自己需要做的一部分事情,让另一个类(也可以就是自己本身)来完成。delegate的方法在被委托的类中必须实现。设计模式中的委托模式。Category即使在你不知道一个类的源码情况下,向这个类添加扩展的方法。通过在interface中声明一个额外的方法并且在implement...
分类:
其他好文 时间:
2015-04-06 16:53:56
阅读次数:
104
Implement pow(x,n).Hide TagsMathBinary Search 题目很简单的。class Solution {public: double pow(double x, int n) { if(n==0) return 1; bool...
分类:
其他好文 时间:
2015-04-06 00:53:50
阅读次数:
141