Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add BFS solution for LeetCode 102 Level Order Traversal#525

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
AHVSSATHVIK wants to merge1 commit intocodedecks-in:master
base:master
Choose a base branch
Loading
fromAHVSSATHVIK:add-bfs-102-level-order

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 forLeetCode Problem 102: Binary Tree Level Order Traversal.
The approach uses a queue to performBreadth-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

welcomebot commentedNov 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 freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

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

@AHVSSATHVIK

[8]ページ先頭

©2009-2025 Movatter.jp