Skip to content

Conversation

@AHVSSATHVIK
Copy link

Pull Request: Add BFS Solution for LeetCode 102 – Binary Tree Level Order Traversal

Description

This pull request adds a BFS-based solution for LeetCode Problem 102: Binary Tree Level Order Traversal.
The approach uses a queue to perform Breadth-First Search, collecting node values level-by-level.
This ensures correct traversal order and maintains time efficiency.

Motivation:
This problem is an essential BFS pattern and belongs to the "Tree" and "BFS/DFS" category, which is requested in Issue #77.

Dependencies:
No additional dependencies are required.


Put check marks:

  • Added problem & solution under correct topic.
  • Specified Space & Time complexity.
    • Time Complexity: O(N)
    • Space Complexity: O(N)
  • Specified difficulty level, tag & Note (if any).
    • Difficulty: Medium
    • Tags: Tree, BFS
    • Note: Standard BFS traversal.

How Has This Been Tested?

The solution has been manually tested by running multiple binary tree inputs on LeetCode’s online judge.
All provided test cases and custom tests have passed without issues.

  • Test A – Basic tree example
  • Test B – Skewed tree & empty tree cases

Make sure all below guidelines are followed else PR will get Reject:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code so that it is easy to understand
  • I have made corresponding changes to the documentation (problem added under correct topic)
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

Closes #77

@welcome
Copy link

welcome bot commented Nov 19, 2025

I can tell this is your first pull request! Thank you I'm so honored. 🎉🎉🎉 I'll take a look at it ASAP!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generate PR for codedecks by solving any DFS/BFS topic problem from LeetCode

1 participant