-
-
Notifications
You must be signed in to change notification settings - Fork 360
Tidy up code imports #194
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
Tidy up code imports #194
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.
Thanks for the contribution! Overall it looks good, but DFS_recursive_postorder
has not been tested and is still half julia code and will need to be fixed. The new import ranges in the markdown files have been verified to be at the correct places now.
def DFS_recursive_inorder_btree(node) | ||
if (len(node.children) == 2) | ||
DFS_recursive_inorder_btree(node.children[1]) | ||
println(n.data) |
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.
I think you mean print(...)
|
||
|
||
# This assumes only 2 children, but accounts for other possibilities | ||
def DFS_recursive_inorder_btree(node) |
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.
Missing :
DFS_recursive_inorder_btree(node.children[1]) | ||
println(n.data) | ||
DFS_recursive_inorder_btree(node.children[2]) | ||
elif (len(n.children) == 1) |
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.
node
, not n
elif (len(n.children) == 1) | ||
DFS_recursive_inorder_btree(node.children[1]) | ||
print(node.data) | ||
elif (len(n.children) == 0) |
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.
node
@@ -34,6 +59,7 @@ def DFS_stack(node): | |||
for child in temp.children: | |||
stack.append(child) | |||
|
|||
|
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.
I don't know if it's established code style, but all other python files use single newline between functions
Thanks for catching that! I suppose it would be a good idea to try running the code before starting a PR. |
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.
Great! Thanks for fixing it. Ready for merging now
@VikingScientist I trust your knowledge. |
Fixed some off-by-one errors in the markdown code imports.
Completed the tree traversal python implementation.