Skip to content

BFS-1 Done#1614

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

BFS-1 Done#1614
vaishnavi2231 wants to merge 1 commit intosuper30admin:masterfrom
vaishnavi2231:master

Conversation

@vaishnavi2231
Copy link
Copy Markdown

No description provided.

@super30admin
Copy link
Copy Markdown
Owner

  1. Strengths:

    • The student has provided multiple solutions (BFS and DFS) for both problems, demonstrating a good understanding of different approaches.
    • The code is well-commented, making it easy to understand the logic and approach.
    • The solutions are efficient and match the expected time and space complexity.
    • The student has handled edge cases (like empty tree or no prerequisites) correctly.
  2. Areas for Improvement:

    • For the BFS solution in "Level Order Traversal," using pop(0) on a list in Python is O(n) time complexity for each operation. It would be more efficient to use collections.deque for O(1) popleft operations.
    • In the DFS solution for "Course Schedule," the student could consider using a separate array or dictionary to track the completion status of courses instead of modifying the hashmap (though the current approach is still correct).
    • The comments could be slightly more detailed, especially explaining why certain steps are taken (e.g., why hashmap[crs] = [] is done in the DFS solution).

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