Uploading Data Structures & Algos Assignment 1.#1
Conversation
mandana-g
left a comment
There was a problem hiding this comment.
Thanks Abeer, your answers look good overall, and your assignment 1 is approved.
Just one important note regarding your time complexity analysis:
The time complexity analysis is inconsistent. You rightly acknowledge that insert() is O(n), and that using it inside a loop leads to O(n²), but then you incorrectly simplify O(n² + n) to O(n). This is a math error as O(n² + n) = O(n²).
Thanks for the feedback and catching the typo - I missed the (^2) when simplifying. The answer has been updated. |
What changes are you trying to make? (e.g. Adding or removing code, refactoring existing code, adding reports)
Trying to identify my problem for Assignment 1 and uploading the answers.
What did you learn from the changes you have made?
I learned how to assess a problem and consider the appropriate abstract data formats (set vs lists). For my question, lists were required as a set would not allow duplicate values (e.g., multiple zero or non-zero values) and, more importantly, would not allow ordering the data to move zero values to the end.
Was there another approach you were thinking about making? If so, what approach(es) were you thinking of?
The alternate approach has been listed in the assignment. :)
There were multiple approaches I considered which might be more "effective" (e.g., a binary search for 0s and moving them to the end of a list, for example) but realized those solutions would require understanding characteristics of a list beforehand. If a random list is used, I couldn't think of a more efficient way of solving the problem.
Were there any challenges? If so, what issue(s) did you face? How did you overcome it?
Biggest challenge was misunderstanding part of the assignment and writing my Python code block in the example code block section, thus impacting my subsequent answers...
How were these changes tested?
N/A
A reference to a related issue in your repository (if applicable)
N/A
Checklist