-
Notifications
You must be signed in to change notification settings - Fork 162
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
Challenges 1-4 in Java #101
Conversation
*/ | ||
public static void invert(Node root) { | ||
|
||
// Stop at the n-1 row |
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.
You probably want to invert if it's got at least one child. The child could be the root of a full tree.
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.
Nice catch!
* | ||
* @author zmiller | ||
*/ | ||
public class Queue<T> { |
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.
Why write this wrapper when this already exists in the Java standrd libs?
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.
There's no reason.
…rt no longer stops at the second to last row, it does a complete DFS now.
|
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.
theres a ton of comments. I bet most of those would be helpful in the readme instead of source. Try to make your code so concise and obvious that it doesnt need comments. Other than that, I like your use of the while loop and isEmpty()
in line 50 of challenge_4/InvertBinaryTree.java
bypass |
No description provided.