Skip to content

Conversation

@Srijha09
Copy link

@Srijha09 Srijha09 commented Oct 3, 2025

No description provided.

@super30admin
Copy link
Owner

Strengths:

  • Good code organization and comments in both solutions.
  • Correct time and space complexity analysis.
  • The queue implementation's shifting logic is well-implemented.

Areas for Improvement:

  • Problem1.py:

    • The pop() and peek() methods should return -1 (or raise an exception) for empty queue instead of None to match standard queue behavior.
  • Problem2.py:

    • The table initialization should create ListNode instances, not classes: self.table = [ListNode() for _ in range(self.size)]
    • The put() method should start checking from cur (head node) instead of cur.next to avoid missing the first node.
    • Consider adding a dummy node at each bucket head to simplify insertion/deletion logic.
    • The remove() method should also check the head node (like get() does) for consistency.

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