-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
base: main
Are you sure you want to change the base?
Conversation
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. |
|
||
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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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:
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: