Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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
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.

1 participant