Java. Trees, Part 2. Iterative depth-first and breadth-first tree traversal.

Опубликовано: 09 Июнь 2026
на канале: Sergey Arkhipov Java Tutorials
25,598
1k

Source code here:
https://github.com/Arhiser/java_tutor...

Previous video on this topic:
   • Java. Деревья ч.1. Рекурсивный обход в глу...  

If you're unsure how a stack and queue work:
   • Java. Очередь и стек.  

Our Telegram group:
https://t.me/ArhiTutorials

Support the channel💰:
https://yoomoney.ru/to/410018856244871

In this video, we'll discuss how to write an iterative algorithm for depth-first and breadth-first traversal of a binary tree using the stack and queue from the previous video. I've also tried to clearly demonstrate the difference between depth-first and breadth-first traversals using a graph search example.

#ArhiTutorialsJava #ityoutubersru