Step by step guide to level order binary tree traversals in Javascript

preview_player
Показать описание
Part 1 of a 3 part series on traversing binary trees

In this video, Liz starts a brand new interview pattern where we perform a level order traversal of a binary tree using a BFS approach with a queue. In each part of this series, Liz walks through an increasingly difficult real interview problem using this pattern in Javascript.

The Challenge (Easy):
Given a binary tree, populate an array to represent its level-by-level traversal.

You should populate the values of all nodes of each level from left to right in separate sub-arrays.

Video Overview:
0:39 Binary tree traversal review
3:01 The problem
3:38 The approach
9:43 Javascript solution
22:07 Overview

Please subscribe to our channel :)

Join us next week for part 2 of this pattern where we’ll walk through a more challenging problem traversing binary trees.

Additional Resources:
* Check out our tiktoks @coderbyte
Рекомендации по теме
Комментарии
Автор

You are my new favorite algorithms teacher, thank you! :)

Mmmtzzz
Автор

great.. In my opinion, BFS and DFS on both binary tree and graph are the must known algorithms for tech interview… glad you covered them all.. awesome!!

g_pazzini
Автор

Your dog is in the back like "This again? Great."

madilinkenmeyer
join shbcf.ru