Skip to content

Update Binary Tree Level Order Traversal (BFS) - Leetcode 102.py #2

New issue

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

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

venchand
Copy link

@venchand venchand commented Jun 3, 2024

Note to @gahogg : Thanks a lot for being an inspiration. Your approach to problems are very unique and you have a clean thought process.

We can avoid the internal for loop by appending None after completion of each level. This has better run time complexity

Leetcode runtime:

Screenshot 2024-06-03 at 1 07 40 PM

We can avoid the internal for loop by appending None after completion of each level.
This has better run time complexity
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant