Open
Conversation
Balanced list of b branch is mixed, because b.append(..) is used. b.insert(0, ..) should be used instead.
Author
|
Also this line in balanced_branches changes the order: The order will stay the same as user defined, if you change it to: It seems that it works fine without this sorting. |
Author
|
@clemtoy What do you think about my previous comment? Are there any reasons to change the order specified by client/user/developer? The balancing itself can be done without reordering/sorting. |
No need to sort children before balancing. The order should stay untouched.
|
do good job! |
|
@kanunnykov Thanks for the suggestion, It worked for me. |
|
Good job! Thanks for your code! |
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.
Fixes issues #2 and #8
Balanced list of b branch is mixed,
because b.append(..) is used.
b.insert(0, ..) should be used instead.
This code:
Currently prints:
But it should do: