Skip to content

Assignment 2#81

Closed
jkhan2211 wants to merge 2 commits into
UofT-DSI:mainfrom
jkhan2211:assignment-2
Closed

Assignment 2#81
jkhan2211 wants to merge 2 commits into
UofT-DSI:mainfrom
jkhan2211:assignment-2

Conversation

@jkhan2211
Copy link
Copy Markdown

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

For the zero-moving problem, removing redundant conditions and debug prints. For the tree duplicate detection, we considered optimizing the BFS approach to track node values more efficiently.

Also, Removing the redundant if nums[x] != nums[index] condition and the debug print statements to simplify the logic and improve code clarity.

What did you learn from the changes you have made?

Cleaner code often performs better and is easier to maintain. The tree algorithm taught me that BFS with hash maps efficiently detects duplicates during traversal.

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

For trees, considering DFS with recursion instead of BFS with queues, but BFS was chosen for level-order traversal benefits.

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

Understanding when to store node values vs nodes themselves. We tested both approaches and chose value tracking for simplicity.

How were these changes tested?

N/A

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

N/A

Checklist

  • [X ] I can confirm that my changes are working as intended

@github-actions
Copy link
Copy Markdown

Hello, thank you for your contribution. If you are a participant, please close this pull request and open it in your own forked repository instead of here. Please read the instructions on your onboarding Assignment Submission Guide more carefully. If you are not a participant, please give us up to 72 hours to review your PR. Alternatively, you can reach out to us directly to expedite the review process.

@jkhan2211 jkhan2211 closed this Oct 20, 2025
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.

1 participant