2015年5月27日

【leetcode】【单链表】【160】Intersection of Two Linked Lists

摘要: #includeusing namespace std;struct ListNode { int val; ListNode *next; ListNode(int x) : val(x), next(NULL) {}};class Solution {public: ListNode *getI... 阅读全文

posted @ 2015-05-27 20:48 ruan875417 阅读(96) 评论(0) 推荐(0) 编辑

【STL源码剖析读书笔记】自己实现简单的空间配置器MyAllocator

摘要: MyAllocator.h#ifndef MY_ALLOCATOR_H#define MY_ALLOCATOR_H#include //placement new#include //ptrdiff_t size_t//分配内存templateinline T* _allocator(ptrdiff... 阅读全文

posted @ 2015-05-27 18:55 ruan875417 阅读(172) 评论(0) 推荐(0) 编辑

【STL源码剖析读书笔记】【第8章】配接器

摘要: 1、 设计模式中对配接器的定义如下:将一个class的接口转换为另一个class的接口,使原本因接口不兼容而不能合作的classes可以一起运作。2、 容器配接器stack和queue是两个容器配接器,底层默认由deque构成。stack封住了所有的deque对外接口,只开放符合stack原则的几个... 阅读全文

posted @ 2015-05-27 10:12 ruan875417 阅读(190) 评论(0) 推荐(0) 编辑

导航