HTTP 各版本之间的差异 前段时间做了一张思维导图,是关于 HTTP 各版本之间主要差异的,做这个的目的还是以梳理自己的知识为主,并借此机会了解下其中的算法: 源文件见: xmind。
ARTS #94 Algorithm 本周选择的算法题是:Copy List with Random Pointer。 规则 A linked list of length n is given such that each node contains an additional random pointer, which could point to any node in the list, or ...
Bignum in Python: 加减法运算 这篇文章记录 Bignum 的加减法运算规则,理解它的最好方式就是直接阅读 Python 源码,我所查阅的版本是 Python-3.9.2,下文引用的代码和分析都基于该版本。 从 Objects/longobject.c 文件里可以找到全部相关的代码,在我们往下之前,先介绍一个预备知识。 一个加法函数可以表示为两个处理绝对值的函数: 绝对值相加的函数 绝对值相减的函数 这...
ARTS #93 Algorithm 本周选择的算法题是:Symmetric Tree。 规则 Given the root of a binary tree, check whether it is a mirror of itself (i.e., symmetric around its center). Example 1: Input: root = [1,2,2,3,4,4,3] O...
Bignum in Python: 内存中的存储 这篇文章主要记录 Python 是如何在从内存中表示 Bignum 的,由于 Python 使用 Bignum 表示所有的整型,所以这也是 Python 对整型的实现方式。 我们知道 Bignum 可以表示任意长度的数字,在内存上表示为一个数组,如数字: 51090942171709440000 可以表示为: [5, 1, 0, 9, 0, 9, 4, 2, 1, 7, 1, 7,...
ARTS #92 Algorithm 本周选择的算法题是:Permutations。 规则 Given an array nums of distinct integers, return all the possible permutations. You can return the answer in any order. Example 1: Input: nums = [1,2,3] Ou...
ROT-13 在 Python 里执行 import this 会打印如下字符串: The Zen of Python, by Tim Peters Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complica...
ARTS #91 Algorithm 本周选择的算法题是:Word Search。 规则 Given an m x n board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentially adjacent cells, where “adjacen...
《发现心流》讲了什么 《发现心流》是一本结构设计得非常好的书,作者像老师一样,带领读者认识心流体验、感受心流体验,并让读者充分认识到获得心流体验的门槛极低。虽然现实生活中也存在像童年悲惨、父母虐待、生活穷困等外在因素,但强调只要带着「面对挑战、解决问题、热爱命运」的态度,相信自己拥有主动权,就能掌握自得其乐的奥秘。 心流的产生 作者将活动分成了三个大类: 生产类 - 工作、学习等活动 维持类 - ...
ARTS #90 Algorithm 本周选择的算法题是:Valid Palindrome。 规则 Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. Note: For the purpose of this problem, we ...