-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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: Update chapter_divide_and_conquer / build_binary_tree_pr… #1653
base: main
Are you sure you want to change the base?
Conversation
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.
Hi Phoenix,
thanks for the hard work. below are just minor changes. the optional ones are optional.
Best Regards,
Kevin
en/docs/chapter_divide_and_conquer/build_binary_tree_problem.md
Outdated
Show resolved
Hide resolved
en/docs/chapter_divide_and_conquer/build_binary_tree_problem.md
Outdated
Show resolved
Hide resolved
en/docs/chapter_divide_and_conquer/build_binary_tree_problem.md
Outdated
Show resolved
Hide resolved
en/docs/chapter_divide_and_conquer/build_binary_tree_problem.md
Outdated
Show resolved
Hide resolved
preorder-> pre-order inorder -> in-order
Thanks for the review and feedback! Updated as suggested. |
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.
@Phoenix0415 Added some comments for your consideration. Thanks for your efforts in this PR.
|
||
!!! question | ||
|
||
Given the pre-order traversal `preorder` and in-order traversal `inorder` of a binary tree, construct the binary tree and return the root node of the binary tree. Assume that there are no duplicate values in the nodes of the binary tree (as shown in the figure below). | ||
Given the pre-order traversal `pre-order` and the in-order traversal `in-order` of a binary tree, construct the binary tree and return its root node. Assume there are no duplicate node values in the binary tree (as shown in the figure 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.
As per the context, the preorder
and inorder
are input of sequences. I would suggest adding "sequence" to them to avoid confusion. Please also note that there is no hyphen in the words as well in the diagram. So, the fist part of the sentence could be:
Given the pre-order traversal preorder
sequence and the in-order traversal inorder
sequence as a binary tree's representation, ...
en/docs/chapter_divide_and_conquer/build_binary_tree_problem.md
Outdated
Show resolved
Hide resolved
|
||
- Pre-order traversal: `[ Root | Left Subtree | Right Subtree ]`, for example, the tree in the figure corresponds to `[ 3 | 9 | 2 1 7 ]`. | ||
- In-order traversal: `[ Left Subtree | Root | Right Subtree ]`, for example, the tree in the figure corresponds to `[ 9 | 3 | 1 2 7 ]`. | ||
- Pre-order traversal: `[ Root | Left Subtree | Right Subtree ]`. For example, in the figure, the tree corresponds to `[ 3 | 9 | 2 1 7 ]`. |
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.
shall we stick to the pattern of capitalization of first letter in first word in "Left Subtree" and "Right Subtree"?
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 feedback! The capitalization of the second word in terms like Left Subtree (e.g., Subtree) is intentional to maintain consistency with code-like structural blocks (e.g., [ Root | Left Subtree | Right Subtree ]), where both words act as a single unit. If aligning with sentence case (e.g., Left subtree) better suits the book’s style, I’m quite happy to adjust. Let me know your preference!
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.
cool. thanks for the explanation. Let's keep it as it is for now.
…oblem.md
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: