Skip to content

Complete BFS-2#1588

Open
PrakarshKamal wants to merge 1 commit intosuper30admin:masterfrom
PrakarshKamal:master
Open

Complete BFS-2#1588
PrakarshKamal wants to merge 1 commit intosuper30admin:masterfrom
PrakarshKamal:master

Conversation

@PrakarshKamal
Copy link
Copy Markdown

No description provided.

@super30admin
Copy link
Copy Markdown
Owner

Your solution for the "Right Side View" problem is excellent. It correctly uses BFS to traverse the tree level by level and adds the last node (rightmost) of each level to the result. The code is clear and efficient.

However, note that you included an additional solution for "Cousins in Binary Tree" in the same file. This is not required for the current problem and should be removed to keep the submission focused. Always ensure that your submission only contains the solution for the problem at hand.

For the "Right Side View" solution, you might consider adding a comment to explain why you are adding the last node (i.e., because it's the rightmost node at that level). But the code is self-explanatory.

Keep up the good work!

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.

2 participants