Skip to content

Linked List 2 complete#1414

Open
Tanmay-Nalawade wants to merge 4 commits intosuper30admin:masterfrom
Tanmay-Nalawade:master
Open

Linked List 2 complete#1414
Tanmay-Nalawade wants to merge 4 commits intosuper30admin:masterfrom
Tanmay-Nalawade:master

Conversation

@Tanmay-Nalawade
Copy link
Copy Markdown

No description provided.

@super30admin
Copy link
Copy Markdown
Owner

  1. Correctness: The second approach for BST Iterator is correct and meets the problem requirements. The first approach, while functionally correct, does not meet the space complexity constraints.
  2. Time Complexity: The second approach correctly achieves amortized O(1) time complexity for next() and hasNext(), and O(h) for initialization.
  3. Space Complexity: The second approach correctly uses O(h) space, where h is the height of the tree, which is optimal.
  4. Code Quality: The code is well-structured and readable. However, including unrelated code from other problems is confusing and should be avoided.
  5. Efficiency: The second approach is efficient and follows the best practices for implementing an iterator over a BST.

Areas for Improvement:

  • Remove unrelated code from the submission to keep it focused on the problem at hand.
  • Clearly separate and label different approaches if multiple solutions are provided.
  • Ensure that all solutions meet the problem constraints, especially space complexity.

Strengths:

  • The student demonstrates a good understanding of the problem and provides a correct and efficient solution in the second approach.
  • The code is clean and follows good practices.

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