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...
Sur cette page du site, vous pouvez voir la vidéo en ligne Google Coding Interview Question: Invert Binary Tree, Python Solution durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Decode Girl 05 janvier 2021, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 251 fois et il a aimé 14 téléspectateurs. Bon visionnage!