Skip to content

finished#14

Open
natalia-ku wants to merge 1 commit intoAda-C7:masterfrom
natalia-ku:master
Open

finished#14
natalia-ku wants to merge 1 commit intoAda-C7:masterfrom
natalia-ku:master

Conversation

@natalia-ku
Copy link

Linked Lists

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 insert method? Provide justification. O(1). Inserting at head, time doesn't depend on size
What is the space complexity of the insert method? Provide justification. O(1), no storage needed
What is the time complexity of the search method? Provide justification. O(n), need to go through whole list
What is the space complexity of the search method? Provide justification. O(1), no storage needed
What is the time complexity of the find_max method? Provide justification. O(n), need to traverse whole list
What is the space complexity of the find_max method? Provide justification. O(1), no storage needed
What is the time complexity of the find_min method? Provide justification. O(n), need to traverse whole list
What is the space complexity of the find_min method? Provide justification. O(1), no storage needed
What is the time complexity of the length method? Provide justification. O (n), need to traverse whole list
What is the space complexity of the length method? Provide justification. O(1), no storage needed
What is the time complexity of the find_nth_from_beginning method? Provide justification. O (n), need to traverse whole list
What is the space complexity of the find_nth_from_beginning method? Provide justification. O(1), no storage needed
What is the time complexity of the insert_ascending method? Provide justification. O (n), need to traverse whole list
What is the space complexity of the insert_ascending method? Provide justification. O(1), no additional storage needed
What is the time complexity of the visit method? Provide justification. O (n), need to traverse whole list
What is the space complexity of the visit method? Provide justification. O(1), no additional storage needed
What is the time complexity of the delete method? Provide justification. O(n), need to traverse whole list
What is the space complexity of the delete method? Provide justification. O(1), no additional storage needed , just one node removed
What is the time complexity of the reverse method? Provide justification. O(n), need to traverse whole list
What is the space complexity of the reverse method? Provide justification. O(1), no additional storage needed
What is the time complexity of the find_middle_value method? Provide justification. O(n) depends on the list's size
What is the space complexity of the find_middle_value method? Provide justification. O(1), no additional storage needed
What is the time complexity of the find_nth_from_end method? Provide justification. O(n) depends on the list's size
What is the space complexity of the find_nth_from_end method? Provide justification. O(1), no additional storage needed
What is the time complexity of the has_cycle method? Provide justification. O(n) depends on the list's size
What is the space complexity of the has_cycle method? Provide justification. O(1), no additional storage needed

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