Hey! My name is Tomas. Thanks for checking out my channel.
Problem
LeetCode 225. Invert Binary Tree
https://lnkd.in/gUu6wtTi
GitHub Solution
https://lnkd.in/gd9bvpKx
Notes
Binary trees are kind of like linked lists but they have a left and right pointer;
Keep a mem of either left or right;
Switch the left and right pointers;
Recurse through the root until we've hit null;
4
/ \
2 7
/\ /\
1 3 6 9
4
/ \
7 2
/\ /\
6 9 1 3
4
/ \
7 2
/\ /\
9 6 3 1
Resources
https://lnkd.in/gRv9x3rf
• Connect with me on LinkedIn: https://www.linkedin.com/in/rtomasgonzalez/
• Connect with me on GitHub: R-Tomas-Gonzalez (Tomas Gonzalez)
Happy Coding!
Download
0 formats
No download links available.
How I solved 226. Invert Binary Tree in JavaScript | NatokHD