Racla's Blog

Go for it.


  • Home

  • About

  • Tags

  • Categories

  • Archives

《Effective C++》阅读总结-类型转换

Posted on 2020-05-12 | In C++
前言本文涉及以下条款: E116: 尽量少做转型动作 M2: 最好使用C++转型操作符 M5: 对定制的“类型转换函数”保持警觉 C++中的类型可以分为两大类:1)内置类型 和 2)自定义类型。类型转换涉及到不同内置类型之间,不同自定义类型之间以及内置类型和自定义类型之间的6种相互转换,如下图所 ...
Read more »

《More Effective C++》阅读总结 - 缓式评估,超急评估(M17, M18)

Posted on 2020-05-11 | In C++
缓式评估缓式评估(Lasy Evaluation)是指对用户虽然提出了某个运算需求,但是暂时用不到运算的结果,我们将此运算延缓到用户需要使用运算结果时。考虑以下代码:123456789template<class T>class Matrix{public: Matrix ...
Read more »

《STL 源码剖析》阅读总结 - 设计模式 适配器模式

Posted on 2020-05-03
适配器模式意图通过新增的适配器类将我们设计的类转化为客户需要的类。 使用场景程序需要使用的类与现有的类之间不同,通过Adapter类进行二者之间的转换。具体如数据库访问时的底层核心适配器,STL只允许读的iteration 实现方法继承或依赖(包含) STL 实践STL中适配器模式主要在三个地方有体 ...
Read more »

《STL 源码剖析》阅读总结 - 设计模式

Posted on 2020-05-03 | In C++
简述关于什么是设计模式及其优缺点的讨论可以在知乎的一些问题上找到:问题1,问题2。 我的理解是,每一个设计模式都是在程序设计过程中遇到的一些问题的解决方案,这些解决方案在实践中被证明在提升开发效率,代码重用性,可读性等方面都具有一定优势。因此我们理解了每一种设计模式解决的问题后,在编码的过程中遵循设 ...
Read more »

92 Reverse Linked List II

Posted on 2019-11-27
Read more »

86 Partition List

Posted on 2019-11-27 | In LeetCode
IntuitionThis question is one step of quick sort: split the list into two parts by a sentinal. We need three pointers to deal with the classifying pro ...
Read more »

23 Merge k Sorted Lists

Posted on 2019-11-27 | In LeetCode
IntuitionThis seems to be a general question of merging two sorted lists. The naive method of this question is quite intuitive. If you are interested ...
Read more »

82 Remove Duplicates from Sorted List II

Posted on 2019-11-27 | In LeetCode
IntuitionThere are several stuff to notice: Remove the duplicates, keep no one of them Find the duplicates by three pointers: pre,cur and next, indic ...
Read more »

19 Remove Nth Node From End of List

Posted on 2019-11-27 | In LeetCode
Intuition & AlogorithmSince it’s a singly linked list, we’d can only count the number of the node from head to tail. The equavalent question of th ...
Read more »

61 Rotate List

Posted on 2019-11-23 | In LeetCode
Intuition & AlgorithmRemove the last k nodes before the head node. Code12345678910111213141516171819202122232425/** * Definition for singly-linked ...
Read more »
12…4
Wan

Wan

Professional Bathroom Singer

32 posts
7 categories
22 tags
GitHub E-Mail Linkedin
0%
© 2019 — 2020 Wan
PV: | Guests:
Powered by Hexo
|
Theme — NexT.Gemini v5.1.4