Skip to content

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

Merged
merged 4 commits into from
Jul 1, 2018
Merged

Tidy up code imports #194

merged 4 commits into from
Jul 1, 2018

Conversation

Thurii
Copy link
Contributor

@Thurii Thurii commented Jul 1, 2018

Fixed some off-by-one errors in the markdown code imports.
Completed the tree traversal python implementation.

@june128 june128 added the Implementation Edit This provides an edit to an algorithm implementation. (Code and maybe md files are edited.) label Jul 1, 2018
Copy link
Contributor

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

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)
Copy link
Contributor

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)
Copy link
Contributor

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)
Copy link
Contributor

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)


Copy link
Contributor

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

@Thurii
Copy link
Contributor Author

Thurii commented Jul 1, 2018

Thanks for catching that! I suppose it would be a good idea to try running the code before starting a PR.
The newlines are there to make it a bit easier to read and follow the PEP 8 style guide.

Copy link
Contributor

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

@june128
Copy link
Member

june128 commented Jul 1, 2018

@VikingScientist I trust your knowledge.

@june128 june128 merged commit c481bf9 into algorithm-archivists:master Jul 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Implementation Edit This provides an edit to an algorithm implementation. (Code and maybe md files are edited.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants