From dd3cbe1bfd0fa3892979c115267b274dce80ffc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=84=BF=E6=97=B6?= <58261676+childrentime@users.noreply.github.com> Date: Sat, 22 Jan 2022 17:21:37 +0800 Subject: [PATCH] Add Chinese Translation (#815) Co-authored-by: Oleksii Trekhleb --- .../linked-list/reverse-traversal/README.md | 3 +++ .../reverse-traversal/README.zh-CN.md | 19 +++++++++++++++++++ .../linked-list/traversal/README.md | 1 + .../linked-list/traversal/README.zh-CN.md | 19 +++++++++++++++++++ 4 files changed, 42 insertions(+) create mode 100644 src/algorithms/linked-list/reverse-traversal/README.zh-CN.md create mode 100644 src/algorithms/linked-list/traversal/README.zh-CN.md diff --git a/src/algorithms/linked-list/reverse-traversal/README.md b/src/algorithms/linked-list/reverse-traversal/README.md index 89187e4f..8a7e3d9e 100644 --- a/src/algorithms/linked-list/reverse-traversal/README.md +++ b/src/algorithms/linked-list/reverse-traversal/README.md @@ -1,5 +1,8 @@ # Reversed Linked List Traversal +_Read this in other languages:_ +[中文](README.zh-CN.md) + The task is to traverse the given linked list in reversed order. For example for the following linked list: diff --git a/src/algorithms/linked-list/reverse-traversal/README.zh-CN.md b/src/algorithms/linked-list/reverse-traversal/README.zh-CN.md new file mode 100644 index 00000000..cf0217a5 --- /dev/null +++ b/src/algorithms/linked-list/reverse-traversal/README.zh-CN.md @@ -0,0 +1,19 @@ +# 链表倒序遍历 + +我们的任务是倒序遍历给定的链表 + +比如下面的链表 + +![](https://upload.wikimedia.org/wikipedia/commons/6/6d/Singly-linked-list.svg) + +遍历的顺序应该是 + +```text +37 → 99 → 12 +``` + +因为我们每个节点只访问一次,时间复杂度应该是`O(n)` + +## 参考 + +- [Wikipedia](https://zh.wikipedia.org/wiki/%E9%93%BE%E8%A1%A8) diff --git a/src/algorithms/linked-list/traversal/README.md b/src/algorithms/linked-list/traversal/README.md index 79e7b436..d1b74ea5 100644 --- a/src/algorithms/linked-list/traversal/README.md +++ b/src/algorithms/linked-list/traversal/README.md @@ -2,6 +2,7 @@ _Read this in other languages:_ [_Русский_](README.ru-RU.md) +[中文](README.zh-CN.md) The task is to traverse the given linked list in straight order. diff --git a/src/algorithms/linked-list/traversal/README.zh-CN.md b/src/algorithms/linked-list/traversal/README.zh-CN.md new file mode 100644 index 00000000..19a01502 --- /dev/null +++ b/src/algorithms/linked-list/traversal/README.zh-CN.md @@ -0,0 +1,19 @@ +# 链表遍历 + +我们的任务是顺序遍历给定的链表 + +比如下面的链表 + +![Singly linked list](https://upload.wikimedia.org/wikipedia/commons/6/6d/Singly-linked-list.svg) + +遍历的顺序应该是 + +```text +12 → 99 → 37 +``` + +因为我们每个节点只访问一次,时间复杂度应该是`O(n)` + +## 参考 + +- [Wikipedia](https://zh.wikipedia.org/wiki/%E9%93%BE%E8%A1%A8) \ No newline at end of file