Skip to content

Conversation

@ashgoel
Copy link

@ashgoel ashgoel commented Apr 20, 2021

Fix for single node tree. Currently it will put nothing in result

Fix for single node tree. Currently it will put nothing in result

public void preorderHelper(Node node) {
if(node.children == null) return;
if(node == null) return; //tree with single node case missing
Copy link
Contributor

Choose a reason for hiding this comment

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

Check already done at line 4.

@rajatag03 rajatag03 closed this Apr 25, 2021
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.

2 participants