![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
设计
liuchenjane
这个作者很懒,什么都没留下…
展开
-
460. LFU Cache
Design and implement a data structure for Least Frequently Used (LFU) cache. It should support the following operations: get and put. get(key) - Get the value (will always be positive) of the key转载 2017-02-08 08:57:35 · 571 阅读 · 0 评论 -
380. Insert Delete GetRandom O(1)
Design a data structure that supports all following operations in average O(1) time. insert(val): Inserts an item val to the set if not already present.remove(val): Removes an item val from the转载 2017-02-15 19:35:44 · 274 阅读 · 0 评论 -
381. Insert Delete GetRandom O(1) - Duplicates allowed
Design a data structure that supports all following operations in average O(1) time. Note: Duplicate elements are allowed. insert(val): Inserts an item val to the collection.remove(val): Remov转载 2017-02-16 09:57:32 · 316 阅读 · 0 评论 -
自定义String类
//一个自建的MyString类 #include <iostream> #include <cstring> using namespace std; class String{ private: char * str; int len; static int num_strings;//number of objects; publ原创 2017-03-25 13:32:15 · 517 阅读 · 0 评论