It has been a while since I've used big- . So i was wondering if I was analyzing this algorithm correctly.
So I am using a linked list, which is a non-indexed list. Each entry essentially "points" to the next one. The list is designed like this:
This is an example, of a linked list of n elements. In order to add another element on to the end of the list we must scan through the entire list until we reach the end and then add the element
Obviously, adding an element is
However, if I start with no elements, and I want to add n elements in sucession. I argue that to add the element, we must scan through elements. So the entire process takes:
Am I right?