20%off off — LaunchSpecial
Exercises/#34 Level Order Traversal (BFS)
#34

Level Order Traversal (BFS)

Medium🌳 Trees
70 XP

Problem

Given the root of a binary tree, return the level order traversal of its nodes' values (left to right, level by level).

Examples

Input: [3,9,20,null,null,15,7]
Output: [[3],[9,20],[15,7]]
treebfsqueue
AI Assistant— powered by AI

Unlock hints progressively — start gentle, go deeper only if needed.

💡

Level 1: Gentle Nudge

A subtle direction

🗺️

Level 2: Approach

The algorithm to use

🔍

Level 3: Detailed

Step-by-step guidance

34 / 150

Your Solution

⚡ JavaScript

to save progress and use AI features