# Key Differences Between Chinese and English Versions in Hello Algo

> Discover key differences between Chinese and English Hello Algo versions. Understand variations in language, comments, and terminology while algorithms remain the same.

- Repository: [Yudong Jin/hello-algo](https://github.com/krahets/hello-algo)
- Tags: tutorial
- Published: 2026-02-25

---

**The Traditional Chinese and English versions of Hello Algo differ only in narrative language, code comments, and terminology notes, while sharing identical underlying algorithms and source code logic.**

The open-source educational repository **krahets/hello-algo** provides algorithmic tutorials in multiple locales, with Traditional Chinese (zh-hant) and English (en) serving as the primary maintained versions. While both versions teach the same data structures and algorithms, they exhibit distinct localization patterns in documentation prose, inline commentary, and community-specific terminology. Understanding these differences helps contributors maintain consistency across locales and assists learners in navigating the appropriate version for their language.

## Content Localization Strategy

The Hello Algo project employs a locale-aware content strategy where algorithmic logic remains constant while surrounding text adapts to each language community. According to the source code structure, the Traditional Chinese version resides under `zh-hant/docs/` while the English equivalent lives under `en/docs/`, with both directories mirroring identical chapter structures such as [`chapter_tree/binary_tree.md`](https://github.com/krahets/hello-algo/blob/main/chapter_tree/binary_tree.md).

The localization extends beyond simple translation to include community-specific terminology conventions. For instance, the Chinese documentation uses punctuation marks like `：` and `、` alongside phrasing such as "層序走訪" for level-order traversal, while the English version in [`en/docs/chapter_tree/binary_tree_traversal.md`](https://github.com/krahets/hello-algo/blob/main/en/docs/chapter_tree/binary_tree_traversal.md) employs standard ASCII punctuation and terms like "Level-order traversal."

## Code-Level Differences

Despite sharing identical class definitions and algorithm implementations, the Chinese and English versions diverge significantly in inline documentation and explanatory comments.

### Inline Code Comments

The most visible difference appears in source code comments embedded within the markdown files. In [`zh-hant/docs/chapter_tree/binary_tree.md`](https://github.com/krahets/hello-algo/blob/main/zh-hant/docs/chapter_tree/binary_tree.md), the C++ node structure carries Traditional Chinese annotations:

```cpp
/* 二元樹節點結構體 */
struct TreeNode {
    int val;          // 節點值
    TreeNode *left;   // 左子節點指標
    TreeNode *right;  // 右子節點指標
    TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
};

```

Conversely, [`en/docs/chapter_tree/binary_tree.md`](https://github.com/krahets/hello-algo/blob/main/en/docs/chapter_tree/binary_tree.md) presents the identical structural code with English commentary:

```cpp
/* Binary tree node */
struct TreeNode {
    int val;          // Node value
    TreeNode *left;   // Left child pointer
    TreeNode *right;  // Right child pointer
    TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
};

```

The Python initialization examples follow the same pattern, with the Chinese version using comments like `# 初始化二元樹` and `# 建構節點之間的引用（指標）`, while the English version uses `# Initialize binary tree` and `# Link references (pointers) between nodes` in the corresponding file locations.

### Terminology Clarification Notes

Both versions explicitly address community-specific naming conventions to prevent confusion among multilingual learners. The Traditional Chinese documentation in [`zh-hant/docs/chapter_tree/binary_tree.md`](https://github.com/krahets/hello-algo/blob/main/zh-hant/docs/chapter_tree/binary_tree.md) includes a terminology tip stating: "請注意，在中文社群中，完美二元樹常被稱為<u>滿二元樹</u>。"

The English counterpart in [`en/docs/chapter_tree/binary_tree.md`](https://github.com/krahets/hello-algo/blob/main/en/docs/chapter_tree/binary_tree.md) provides the equivalent clarification: "Please note that in the Chinese community, a perfect binary tree is often referred to as a full binary tree." This bidirectional terminology mapping ensures that readers understand regional naming variations regardless of which locale they choose.

## File Structure and Asset Management

The repository maintains separate but parallel directory structures to support the static site generator (MkDocs) in serving locale-appropriate content. Key files follow this pattern:

- **Chinese (Traditional)**: [`zh-hant/docs/chapter_tree/binary_tree.md`](https://github.com/krahets/hello-algo/blob/main/zh-hant/docs/chapter_tree/binary_tree.md) contains binary tree definitions, Chinese-language tips, and localized initialization examples.
- **English**: [`en/docs/chapter_tree/binary_tree.md`](https://github.com/krahets/hello-algo/blob/main/en/docs/chapter_tree/binary_tree.md) hosts the same algorithmic material with English prose and comments.
- **Configuration**: Locale-specific MkDocs configurations reside in [`zh-hant/mkdocs.yml`](https://github.com/krahets/hello-algo/blob/main/zh-hant/mkdocs.yml) and [`en/mkdocs.yml`](https://github.com/krahets/hello-algo/blob/main/en/mkdocs.yml), linking the respective documentation sets.

Asset management follows a per-locale duplication strategy. Both versions reference images such as `binary_tree.assets/perfect_binary_tree.png`, but these assets are duplicated under each language directory (`zh-hant/docs/chapter_tree/` and `en/docs/chapter_tree/`) to maintain clean relative paths and prevent cross-locale confusion during the build process.

## Summary

The Hello Algo repository implements a clean separation between algorithmic logic and natural language presentation:

- **Shared codebase**: Core algorithms, class definitions, and data structure implementations remain identical across Chinese and English versions.
- **Localized commentary**: All inline comments, section headers, and explanatory text are fully translated while preserving technical accuracy.
- **Community-aware terminology**: Both versions explicitly note regional naming differences (such as "滿二元樹" versus "full binary tree") to aid cross-cultural understanding.
- **Parallel file structures**: The `zh-hant/` and `en/` directories mirror each other exactly, with locale-specific MkDocs configurations managing the build process.
- **Asset duplication**: Images and diagrams are duplicated per locale to ensure correct path resolution in the generated static sites.

## Frequently Asked Questions

### Does the Chinese version of Hello Algo contain different algorithms than the English version?

No. The underlying algorithms, data structures, and code logic are identical in both versions. The only differences appear in natural language text, code comments, and terminology notes. For example, the `TreeNode` struct definition in [`zh-hant/docs/chapter_tree/binary_tree.md`](https://github.com/krahets/hello-algo/blob/main/zh-hant/docs/chapter_tree/binary_tree.md) contains exactly the same member variables and constructor logic as its counterpart in [`en/docs/chapter_tree/binary_tree.md`](https://github.com/krahets/hello-algo/blob/main/en/docs/chapter_tree/binary_tree.md).

### Why are image assets duplicated in both the Chinese and English directories?

The assets are duplicated under `zh-hant/docs/` and `en/docs/` to support the MkDocs static site generator's locale-aware build process. While the actual image files (such as `binary_tree.assets/perfect_binary_tree.png`) are identical, maintaining separate copies ensures that relative links resolve correctly within each localized site structure without cross-directory confusion.

### How does Hello Algo handle community-specific terminology differences?

The documentation explicitly addresses regional naming variations through terminology tips. In the Traditional Chinese version, the text notes that "完美二元樹" is often called "滿二元樹" in Chinese communities, while the English version translates this note to inform international readers about Chinese conventions. This bidirectional clarification appears in the binary tree chapters of both locales.

### Can I contribute translations to Hello Algo if I only see Chinese or English content?

Yes. The repository structure in `krahets/hello-algo` supports multiple locales through parallel directory structures. Contributors can reference the existing `zh-hant/` or `en/` implementations as templates, ensuring that code logic remains unchanged while translating only the prose, comments, and UI strings in the corresponding MkDocs configuration files.