100. Same Tree (breadth first search) | Python + Leetcode Technical Interview Practice

preview_player
Показать описание
Let's learn Python while also keeping up to shape for future FAANG and general technical programming interviews. I will be solving Leetcode problems every other day and documenting my thoughts as I go along, so hopefully you can get inspired to try some of the programming best practices I've learned so far yourself.
Рекомендации по теме
Комментарии
Автор

Hey everybody,
Just a quick correction. This is the Breadth First Search implementation, not the Depth First Search. Sorry for the confusion :)
In the DFS algorithm you just need to switch from taking the oldest element of the queue to taking the youngest - so a reverse order queue. That is it! Try it yourself and good luck learning!

MeggaMortous