![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Effective
文章平均质量分 75
骚铭科技
这个作者很懒,什么都没留下…
展开
-
智能指针
智能指针shared_ptr用途shared_ptr目的是为了解决资源泄露的问题。学C++的时候,老师千叮万嘱new了之后一定要delete掉,否则很容易发生内存泄露等问题。但实际上,new/delete这种模式会出现很多问题。我知道的有两点: 1. 忘记delete。 有时候代码比较复杂,或者没有直接使用new(例如在成员函数中new),是非常容易忘记delete的。 2. 在执行d原创 2015-10-23 20:01:16 · 346 阅读 · 0 评论 -
[Leetcode] LRU Cache. 哈希表+双向链表之实现
题目首先来看题目,就是实现一个LRU,最近最少使用。 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 value (will alwa原创 2015-12-12 14:45:11 · 3175 阅读 · 1 评论