Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

translation: optimize translation for selection sort #1600

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

yuelinxin
Copy link
Contributor

If this pull request (PR) pertains to Chinese-to-English translation, please confirm that you have read the contribution guidelines and complete the checklist below:

  • This PR represents the translation of a single, complete document, or contains only bug fixes.
  • The translation accurately conveys the original meaning and intent of the Chinese version. If deviations exist, I have provided explanatory comments to clarify the reasons.

If this pull request (PR) is associated with coding or code transpilation, please attach the relevant console outputs to the PR and complete the following checklist:

  • I have thoroughly reviewed the code, focusing on its formatting, comments, indentation, and file headers.
  • I have confirmed that the code execution outputs are consistent with those produced by the reference code (Python or Java).
  • The code is designed to be compatible on standard operating systems, including Windows, macOS, and Ubuntu.

@yuelinxin
Copy link
Contributor Author

I've changed the translation for "未排序区间" from "unsorted interval" to "unsorted section", which in my opinion is the right translation, "interval" usually refers to a gap between two fixed points, which is not what the Chinese version meant, so if @krahets agrees, please also make this change in the figures of this page.

en/docs/chapter_sorting/selection_sort.md Outdated Show resolved Hide resolved
en/docs/chapter_sorting/selection_sort.md Outdated Show resolved Hide resolved

1. Initially, all elements are unsorted, i.e., the unsorted (index) interval is $[0, n-1]$.
2. Select the smallest element in the interval $[0, n-1]$ and swap it with the element at index $0$. After this, the first element of the array is sorted.
3. Select the smallest element in the interval $[1, n-1]$ and swap it with the element at index $1$. After this, the first two elements of the array are sorted.
4. Continue in this manner. After $n - 1$ rounds of selection and swapping, the first $n - 1$ elements are sorted.
5. The only remaining element is necessarily the largest element and does not need sorting, thus the array is sorted.
5. The only remaining element is subsequently the largest element and does not need sorting, thus the array is sorted.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Necessarily accurately conveys this inevitability. It emphasizes that, by the algorithm's logic, the last remaining element cannot be anything other than the largest. But the subsequently doesn't capture the inevitability that the last element must be the largest.

Maybe we can use: The only remaining element is necessarily the largest and does not require sorting, thus the array is sorted.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think "subsequently" here is trying to emphasize the causal relationship between step 1 ~ 4 to the outcome of step 5. This is strictly a difference in perspective so I still think "subsequently" is better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants