Skip to content

Tree traversal in MATLAB #690

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 5 commits into from
May 26, 2020

Conversation

foldsters
Copy link
Contributor

All code sections are included. Accidentally deleted some lines during debugging and added them back in.

@berquist berquist added the Implementation This provides an implementation for an algorithm. (Code and maybe md files are edited.) label May 24, 2020
@foldsters
Copy link
Contributor Author

Accidentally pushed to the wrong branch, fixing now

@foldsters foldsters force-pushed the tree_traversal_in_matlab branch from 30b71e1 to 76cf2bb Compare May 24, 2020 03:01
@foldsters
Copy link
Contributor Author

Okay that should be fixed

Copy link

@PeterMek PeterMek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've never really been a fan of cell arrays or map containers but here I am. The code is really good, very true to the AAA chapter as well, it goes through all the implementations mentioned in order.

I'd suggest replacing "if length(x)" with "~isempty(x)" which is immeasurably quicker (not that it really matters here). This suggestion also works for the while loops in the stack and queue functions simply: "while ~isempty(x)".

Might also be wise to add an fprintf("\n") after line 148 so that the code exist on a new line rather than the output one.

Otherwise it's great, not commented but the variables and routines are so well labelled I could hardly find a place where comments were necessary to know what was going on.

@foldsters
Copy link
Contributor Author

I'm not a fan of cell arrays either, but it seems it's the only way to get type-agnostic tree structures.

I'll work on the updates now.

@foldsters
Copy link
Contributor Author

That should be good to go!

Copy link

@PeterMek PeterMek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, that's a solid approve from me

Copy link
Member

@leios leios left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am happy with the review by @PeterMek, and it seems to build locally just fine.

@leios leios merged commit 2f06313 into algorithm-archivists:master May 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Implementation This provides an implementation for an algorithm. (Code and maybe md files are edited.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants