Retranslate the complete English edition from Simplified Chinese (#2010)

* Retranslate the complete English edition from Simplified Chinese

* Polish three English explanations after reader-focused review
This commit is contained in:
Yudong Jin
2026-10-31 03:35:51 +08:00
committed by GitHub
parent ef46e2ed95
commit 14c314c08c
1502 changed files with 29459 additions and 23517 deletions

View File

@@ -6,7 +6,7 @@
#include <cassert>
/* Iterative summation */
/* Sum using iteration */
int sumIter(int n) {
int res = 0;
for (int i = 1; i <= n; ++i) {
@@ -15,7 +15,7 @@ int sumIter(int n) {
return res;
}
/* Recursive summation */
/* Sum using recursion */
int sumRecur(int n) {
if (n == 1) {
return 1;
@@ -23,7 +23,7 @@ int sumRecur(int n) {
return n + sumRecur(n - 1);
}
/* Linear loop */
/* Linear-time loop */
int linearLoop(int n) {
int res = 0;
for (int i = 0; i < n; ++i) {
@@ -32,7 +32,7 @@ int linearLoop(int n) {
return res;
}
/* Quadratic loop */
/* Quadratic-time loop */
int quadraticLoop(int n) {
int res = 0;
for (int i = 0; i < n; ++i) {
@@ -43,7 +43,7 @@ int quadraticLoop(int n) {
return res;
}
/* Logarithmic loop */
/* Logarithmic-time loop */
int logarithmicLoop(int n) {
while (n > 1) {
n /= 2;