Skip to content

Assignment-1: Implement Question Two: Valid Bracket Sequence.#1

Open
VincentSchaik wants to merge 1 commit intomainfrom
assignment-1
Open

Assignment-1: Implement Question Two: Valid Bracket Sequence.#1
VincentSchaik wants to merge 1 commit intomainfrom
assignment-1

Conversation

@VincentSchaik
Copy link
Owner

What changes are you trying to make? (e.g. Adding or removing code, refactoring existing code, adding reports)

  • Completed is_valid_brackets with stack based solution and documented its behaviour.
  • Added extra validation with the provided sample cases plus new examples.
  • Added written explanations Big-O analysis and the simplified paraphrases requested for the prompt.

What did you learn from the changes you have made?

  • Reinforced how stack based parsing of bracket strings delivers optimal time.
  • Saw how iterative string-replacement offers a simpler but less efficient alternate solution and how that affects complexity.

Was there another approach you were thinking about making? If so, what approach(es) were you thinking of?

  • Considered using a counter-based approach but it fails for mixed bracket types.
  • Settled on stack plus the replacement method to contrast efficiency and readability.

Were there any challenges? If so, what issue(s) did you face? How did you overcome it?

N/A

How were these changes tested?

  • Ran the provided bracket examples and the new examples for both implementations inside the notebook cells to verify expected True/False outputs.

A reference to a related issue in your repository (if applicable)

N/A

Checklist

  • I can confirm that my changes are working as intended

@VincentSchaik
Copy link
Owner Author

Assignment 1 Completed.

Copy link

@tianyi21 tianyi21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Vincent,

Thank you for submitting your ADS A1.

✅ You demonstrated your understanding of the assigned question.
✅ Your Python code runs successfully without any errors.
✨ You utilized the stack and dict data structures in your implementation.
✅ Your program produces the intended results.
✅ You correctly explained your implementation and analyzed its time and space complexities.
✅ You proposed an alternative solution to the question.
✨ You also implemented and tested the alternative solution.

Your A1 is complete.

Thanks,
Tianyi [LS]

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