Binary Tree Level Order Traversal Leet Code Question Explained | BFS recursively and iteratively

preview_player
Показать описание
In this video we will look at solving the Binary Tree Level Order Traversal Leet Code Question

00:00: Introduction
00:35 : Leet Code Problem + Examples
00:58: Intution to solve the problem
01:44: Steps to solve the problem recursively
04:52: Recursive Live Code
08:26: Steps to solve the problem iteratively
09:53: Iterative Live Code
Рекомендации по теме
Комментарии
Автор

recursion is inherently dfs - well said. Watched a bunch of bfs videos but nobody mentioned it

tapsup
Автор

The 1st one (Pre-Order) is DFS, not BFS.
Only the 2nd one is BFS.
Both are iterative, not recursive.

samer
Автор

Thanks I’ve been working on this problem for days it’s frustrating because I make 0 progress

billymays
Автор

is preorder traversal really needed? cause we can access it using depth and then we can append easily based on depth in the result list

subhamtripathi
join shbcf.ru