-
-
Notifications
You must be signed in to change notification settings - Fork 359
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
Tree traversal in MATLAB #690
Conversation
Accidentally pushed to the wrong branch, fixing now |
30b71e1
to
76cf2bb
Compare
Okay that should be fixed |
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'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.
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. |
That should be good to go! |
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.
Awesome, that's a solid approve from me
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 am happy with the review by @PeterMek, and it seems to build locally just fine.
All code sections are included. Accidentally deleted some lines during debugging and added them back in.