剑指offer
剑指offer
荷西·H
你不知道这份散发臭味的代码经历了多少次需求变更。
展开
-
链表添加函数中为什么要用指向链表指针的指针
读剑指offer的时候没有理解,网上有个blog说的特别好,我总结一下: (源代码在此) #include <iostream> #include <string> using namespace std; struct ListNode { int val; ListNode* next; }; void AddToTail(ListNode** pHead,...转载 2019-02-21 23:55:19 · 1400 阅读 · 3 评论 -
lintcode 剑指offer 212 Space Replacement
第一次用python写算法,果然发现了自己很多对python不熟练的地方… class Solution: """ @param: string: An array of Char @param: length: The true length of the string @return: The true length of new string """ ..原创 2019-02-19 20:45:34 · 187 阅读 · 0 评论 -
c++四个类型转换相关的关键字【tl,dr】
tldr 先马住… 在C/C++语言中用 (type) value(在C++还可以采用type(value))来进行显式类型转换(explicit type conversion),常常又被称为强制转换(cast投射/铸模)。这种转换的正确性完全掌握在程序员手中,传统上强制转换往往被过度使用,成为C++程序犯错的一个主要根源。 为了减少强制转换的副作用,并且在查错时使程序员能够快速定位(总是最值...转载 2019-02-19 21:12:50 · 370 阅读 · 0 评论 -
const int | int const | const int * | int* const
转载自 https://blog.csdn.net/huangchijun11/article/details/72725463 前言:很多人都把const int * 、int * const、int const* 的区别和联系搞混,我自己在学习C++的过程中,也经常性 弄不 清楚,今天特意总结一下,作为学习笔记记录下来。 一,const修饰符用于指针 将const用于指...原创 2019-02-20 14:48:00 · 239 阅读 · 0 评论