Several bug fixes and improvements (#945)

* Update Dockerfile for code debugging.

* Format Python code using Black.

* Improve dark theme by defining html classes for the figures, animations and cover images.

* Fix several glossary translation.

* Update a code comment.

* Fix climbing_stairs_backtrack: the pruning should not require the sorted choices list.

* Update the code of array and list traversal.

* Fix a rendering issue of README.md

* Update code of list traversal.

* Fix array_definition.png

* Update README.md

* Fix max_capacity_moving_short_board.png

* Fix array.dart

* Fix array.dart

* Fix array.dart

* Fix array.dart
This commit is contained in:
Yudong Jin
2023-11-14 21:27:35 +08:00
committed by GitHub
parent 9baf4a1753
commit fcbaf101a4
64 changed files with 212 additions and 218 deletions

View File

@@ -2,7 +2,7 @@
<div class="center-table" markdown>
![数据结构](../assets/covers/chapter_data_structure.jpg){ width="600" }
![数据结构](../assets/covers/chapter_data_structure.jpg)
</div>

View File

@@ -18,7 +18,7 @@
![原码、反码与补码之间的相互转换](number_encoding.assets/1s_2s_complement.png)
「原码 true form」虽然最直观,但存在一些局限性。一方面,**负数的原码不能直接用于运算**。例如在原码下计算 $1 + (-2)$ ,得到的结果是 $-3$ ,这显然是不对的。
「原码 signmagnitude」虽然最直观,但存在一些局限性。一方面,**负数的原码不能直接用于运算**。例如在原码下计算 $1 + (-2)$ ,得到的结果是 $-3$ ,这显然是不对的。
$$
\begin{aligned}
@@ -29,7 +29,7 @@ $$
\end{aligned}
$$
为了解决此问题,计算机引入了「反码 1's complement code」。如果我们先将原码转换为反码,并在反码下计算 $1 + (-2)$ ,最后将结果从反码转化回原码,则可得到正确结果 $-1$ 。
为了解决此问题,计算机引入了「反码 1's complement」。如果我们先将原码转换为反码并在反码下计算 $1 + (-2)$ ,最后将结果从反码转化回原码,则可得到正确结果 $-1$ 。
$$
\begin{aligned}
@@ -51,7 +51,7 @@ $$
\end{aligned}
$$
与原码一样,反码也存在正负零歧义问题,因此计算机进一步引入了「补码 2's complement code」。我们先来观察一下负零的原码、反码、补码的转换过程:
与原码一样,反码也存在正负零歧义问题,因此计算机进一步引入了「补码 2's complement」。我们先来观察一下负零的原码、反码、补码的转换过程
$$
\begin{aligned}