Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aurora Anderson #23

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Aurora Anderson #23

wants to merge 3 commits into from

Conversation

auroralemieux
Copy link

Restricted Array

Congratulations! You're submitting your assignment.

Comprehension Questions

What is the time and space complexity for each method you implemented? Provide justification.

Question Answer
What is the time complexity of the length method? Provide justification. O(n) because you have to visit each element to count it.
What is the space complexity of the length method? Provide justification. Constant time because you don't need any extra storage other than what's passed in. Not sure on this though.
What is the time complexity of the print_array method? Provide justification. Same as length.
What is the space complexity of the print_array method? Provide justification. Same as length.
What is the time complexity of the reverse method? Provide justification. O(n) because you're visiting each element once.
What is the space complexity of the reverse method? Provide justification. There are more variables but no additional data structures so still constant.
What is the time complexity of the search method? Provide justification. O(n) for same reason.
What is the space complexity of the search method? Provide justification. constant because no addt'l storage.
What is the time complexity of the sort method? Provide justification. DIDN'T DO. But I'm guessing it's a lot more than O(n).
What is the space complexity of the sort method? Provide justification. DIDN'T DO.
What is the time complexity of the delete method? Provide justification. O(n)
What is the space complexity of the delete method? Provide justification. O(1)
What is the time complexity of the empty method? Provide justification. O(n)
What is the space complexity of the empty method? Provide justification. constant
What is the time complexity of the find_largest method? Provide justification. O(n)
What is the space complexity of the find_largest method? Provide justification. constant
What is the time complexity of the insert_ascending method? Provide justification. DIDN'T DO.
What is the space complexity of the insert_ascending method? Provide justification. DIDN'T DO.

I didn't finish this but am doing the PR and moving on in the interest of catching up.

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