-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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 the translation of hash_map.md #1358
base: main
Are you sure you want to change the base?
Conversation
en/docs/chapter_hashing/hash_map.md
Outdated
|
||
As shown in the figure below, given $n$ students, each with two pieces of data: "name" and "student number". If we want to implement a query feature that returns the corresponding name when given a student number, we can use the hash table shown in the figure below. | ||
As shown in the diagram below, given $n$ students, each student has two data fields: "Name" and "Student ID". If we want to implement a query function that takes a student ID as input and returns the corresponding name, we can use the hash table depicted below. |
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.
the hash table depicted below -> the hash table shown in the figure below
The keywords "the figure below" will be replaced with the Figure number during the build process, so don't modify them.
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.
done
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.
Thanks for the PR! Please address the comments.
- **Deleting elements**: First, locate the element, then delete it from the array (or linked list), using $O(n)$ time. | ||
- **Inserting an element**: Simply append the element to the tail of the array (or linked list). The time complexity of this operation is $O(1)$. | ||
- **Searching for an element**: As the array (or linked list) is unsorted, searching for an element requires traversing through all of the elements. The time complexity of this operation is $O(n)$. | ||
- **Deleting an element**: In order to remove elements, we need to locate them first. Then, delete them from the array (or linked list). The time complexity of this operation is $O(n)$. |
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.
Starting a sentence with "Then, ..." is controversial (It's grammatically OK, but feels sudden/jarring). Just a style suggestion but maybe something like "To remove elements, we first need to locate them. After locating the elements, we delete them from the array (or linked list)..."
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.
Thank you for your suggestion. However, I think changing from "Then...." to duplicated words "locate..." might not be a good idea. How about something like "To remove elements, we first need to locate them. Subsequently, we delete..."?
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: