Skip to content

Conversation

@Shiva2v2
Copy link

No description provided.

@super30admin
Copy link
Owner

  1. Correctness:

    • Exercise_1.py: The stack implementation appears correct with basic operations (push, pop, peek, size, show). However, there's a syntax error in the time and space complexity comments (missing # before comments). The indentation in the peek method is incorrect.
    • Exercise_2.py: The stack implementation using linked list is mostly correct but has a typo in pop() method (popped_val vs popped_value). The time and space complexity comments have incorrect syntax (/ instead of #).
    • Exercise_3.py: The singly linked list implementation is incomplete. The append method is unfinished (cut off mid-sentence) and has a typo (curren instead of current). The remove method doesn't return anything when key isn't found.
  2. Time Complexity:

    • Exercise_1.py: Correctly identified as O(1) for all operations except show() which is O(n).
    • Exercise_2.py: Correctly identified as O(1) for push/pop, though the comment syntax is wrong.
    • Exercise_3.py: Not properly analyzed. Append is O(n), find is O(n), remove is O(n).
  3. Space Complexity:

    • Exercise_1.py: Correctly identified as O(n).
    • Exercise_2.py: Correctly identified as O(n), though comment syntax is wrong.
    • Exercise_3.py: Not properly analyzed. Space complexity is O(n).
  4. Code Quality:

    • Exercise_1.py: Mostly clean but needs proper comment syntax and fixed indentation.
    • Exercise_2.py: Good structure but has a variable name inconsistency and incorrect comment syntax.
    • Exercise_3.py: Incomplete implementation with typos and missing functionality.
  5. Efficiency:

    • All implementations could benefit from proper docstrings and comments.
    • Exercise_3.py needs to be completed and tested thoroughly.
    • Error handling could be improved in all implementations (e.g., what happens when popping from empty stack).

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