Update display function to display_tree for visual tree representation.#8886
Closed
di-was wants to merge 13 commits intoTheAlgorithms:masterfrom
di-was:binary_display
Closed
Update display function to display_tree for visual tree representation.#8886di-was wants to merge 13 commits intoTheAlgorithms:masterfrom di-was:binary_display
di-was wants to merge 13 commits intoTheAlgorithms:masterfrom
di-was:binary_display
Conversation
cclauss
reviewed
Jul 24, 2023
cclauss
reviewed
Jul 24, 2023
Member
|
How is the proposed code better than the current code? The current recursive approach is kinda slick. Perhaps show the output of the two here so we can see the before and after. |
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Author
|
@cclauss The current display function presents nodes in a vertical format, which may lack intuitive clarity for certain people. The proposed method offers a more visually beneficial presentation of the tree. Initial functionnew functionBoth functions display a tree, with one root node and two children nodes , however, the second functions is visually helpful |
for more information, see https://pre-commit.ci
cclauss
reviewed
Jul 24, 2023
Contributor
|
@cclauss kindly review this also. |
cclauss
reviewed
Sep 24, 2023
| 2 | ||
| 1 | ||
| 0 | ||
| """ |
Member
There was a problem hiding this comment.
If I turn this diagram 90 clockwise (so that 1 is on top) then 2 is to the left of 1 and 0 is to the right of 1 which is the opposite of lines 36 and 37.
|
Nice |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your change: The new binary tree display function performs a in order depth-first traversal and displays the tree, in a way which is helpful to visualize the structure of the tree.
Checklist: