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: Update chapter_divide_and_conquer / build_binary_tree_pr… #1653

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

Conversation

Phoenix0415
Copy link
Contributor

…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:

  • 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.

Copy link
Contributor

@K3v123 K3v123 left a 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

@Phoenix0415
Copy link
Contributor Author

Hi Phoenix, thanks for the hard work. below are just minor changes. the optional ones are optional.

Best Regards, Kevin

Thanks for the review and feedback! Updated as suggested.

Copy link
Contributor

@thomasq0 thomasq0 left a 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).
Copy link
Contributor

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, ...


- 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 ]`.
Copy link
Contributor

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"?

Copy link
Contributor Author

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!

Copy link
Contributor

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.

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.

3 participants