Skip to content

Commit 4a0c428

Browse files
Create inverting a binary tree (#338)
1 parent c82b9d5 commit 4a0c428

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Trees/inverting a binary tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
void invert(node*root)
2+
{
3+
if(root!=NULL)
4+
{
5+
invert(root->left);
6+
invert(root->right);
7+
swap(root->left,root->right);
8+
}
9+
}
10+
Footer

0 commit comments

Comments
 (0)