You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, thank you for creating this course, Brian. I didn't realize how much I would enjoy the study of algorithms and recursion.
Second, I have a question regarding the Big O for Linked Lists, specifically for deletes. On line 429 of the course materials, you say that "LinkedList's adds and deletes are O(1) but the gets are O(n)". However, the delete method we implemented uses the _find method (if we are not deleting the head), which contains a loop. Would this not mean that delete is also (usually) O(n)? Building on that, would this also mean that the LinkedList is really only optimized for adds?
Looking at the Big O cheatsheet, they describe a singly linked list as having O(n) for access and search, while having O(1) for insertion and deletion, so I know I must be misunderstanding something. Could you provide a little more explanation behind this? I would greatly appreciate it 😄
The text was updated successfully, but these errors were encountered:
First, thank you for creating this course, Brian. I didn't realize how much I would enjoy the study of algorithms and recursion.
Second, I have a question regarding the Big O for Linked Lists, specifically for deletes. On line 429 of the course materials, you say that "LinkedList's adds and deletes are O(1) but the gets are O(n)". However, the
delete
method we implemented uses the_find
method (if we are not deleting the head), which contains a loop. Would this not mean that delete is also (usually) O(n)? Building on that, would this also mean that the LinkedList is really only optimized for adds?Looking at the Big O cheatsheet, they describe a singly linked list as having O(n) for access and search, while having O(1) for insertion and deletion, so I know I must be misunderstanding something. Could you provide a little more explanation behind this? I would greatly appreciate it 😄
The text was updated successfully, but these errors were encountered: