This problem has been asked by Google, Facebook and Amazon and it is one of the most common questions on trees so it would definitely help learning it.
In this video I give you two ways of approaching this problem in an interview setting.
To access the code here are the links to the two solutions:
recursive approach: https://gist.github.com/Surai98/88828...
iterative approach:
https://gist.github.com/Surai98/ca2a5...
Nesta página do site você pode assistir ao vídeo on-line Google Coding Interview Question: Invert Binary Tree, Python Solution duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Decode Girl 05 Janeiro 2021, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 251 vezes e gostou 14 espectadores. Boa visualização!