Skip to content
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

Merged
merged 6 commits into from
Jan 3, 2017
Merged

Conversation

zmiller91
Copy link
Contributor

No description provided.

*/
public static void invert(Node root) {

// Stop at the n-1 row

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.

Copy link
Contributor Author

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> {

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's no reason.

@zmiller91 zmiller91 changed the title Challenge 4: Invert a binary tree Challenge 1-4 in Java Jan 3, 2017
@zmiller91 zmiller91 changed the title Challenge 1-4 in Java Challenges 1-4 in Java Jan 3, 2017
…rt no longer stops at the second to last row, it does a complete DFS now.
@Remillardj
Copy link
Contributor

Remillardj commented Jan 3, 2017

  • Code review
  • Correct path
  • Code tested
  • Check for conflicts
  • Merge PR

Copy link
Contributor

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

@Remillardj
Copy link
Contributor

bypass

@Remillardj Remillardj merged commit 6077ff9 into YearOfProgramming:master Jan 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants