ARTS #98 Algorithm 本周选择的算法题是:Merge Two Binary Trees。 规则 You are given two binary trees root1 and root2. Imagine that when you put one of them to cover the other, some nodes of the two trees are overlapp...
上线「站内搜索」 这周为博客增加了「站内搜索」功能,算是解决了自己搜索不便的一大痛点。 最开始打算实现像 vuepress2 那样看起来很酷的效果,它的服务提供商是 algolia,虽然有免费的版本,但限制很多,需要自己生成索引文件、手动上传至 algolia 的服务器、有搜索限额,最重要的是整个过程不能完全自动化(除非花钱),只得放弃。 后来想到利用 Jekyll 的文件处理流程,其实可以很容易的实时生...
ARTS #97 Algorithm 本周选择的算法题是:Linked List Cycle。 规则 Given head, the head of a linked list, determine if the linked list has a cycle in it. There is a cycle in a linked list if there is some node in the l...
分享一本词典: AHD AHD - 美国传统词典 AHD(American Heritage Dictionary) 是我在 macOS 下使用多年的词典,它的主要功能有: 强大英英解释功能 词性释义丰富 有语源,更容易理解它的词根 示例 love love [lʌv] ■n.(名词) ▪A deep, tender, ineffable feeling of affection and...
ARTS #96 Algorithm 本周选择的算法题是:largest Rectangle in Histogram。 规则 Given an array of integers heights representing the histogram’s bar height where the width of each bar is 1, return the area of the largest...
2021 Q1 阅读记录 从去年开始对阅读做了些优化: 增加碎片时段阅读的时长 扩大阅读书籍的边界 根据书中内容调整阅读方式 优化后的效果还是很明显,今年的 Q1 就读了四本书。 发现心流 这是一本论述性的书,它的内核是: 探索人类快乐的本质,分析了人在不同的活动、环境、人际关系及受外在因素的影响下,对自身感受会造成的潜在影响。并说明了要在行为与思想上应当如何去做,才能乐在其中又或是苦...
ARTS #95 Algorithm 本周选择的算法题是:Minimum Window Substring。 规则 Given two strings s and t, return the minimum window in s which will contain all the characters in t. If there is no such window in s that covers...
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 文件里可以找到全部相关的代码,在我们往下之前,先介绍一个预备知识。 一个加法函数可以表示为两个处理绝对值的函数: 绝对值相加的函数 绝对值相减的函数 这...