There are people here who can't accept that insertion into a linked list is O(1), regardless of where you are inserting.
>>55091233
It's O(2) actually.
>>55091233
It isn't O(1) if you don't have the address of the previous node.
>>55091233
If it's unsorted. Kill yourself you CS 101 student.
>>55091315
>>55091320
The insertion is O(1). The search is O(n)
>>55091329
How?
You need to specify 2 references ,therefore 2 separate actions so O(2).
>>55091362
Make it O(3). You have to create the new node.
>>55091362
>>55091371
Think you're a bit confused about O notation mate.
>>55091383
Yeah mate I think O(5 and 1/2) would be more appropriate
>>55091383
You might be right. I still haven't figured out the chapter on big oh notation when they taught it in discreet maths
>>55091329
If that's really your reasoning, then this is just a dumb trick question. When you say insertion, it's pretty much taken to mean insertion into an arbitrary position, which includes the search.
>>55091266
no amigo ur fucking wrong that's not how big ohohoh works
>>55091537
No sorry.
>>55091405
>>55091371
>>55091362
>>55091315
>>55091266
Confirmed for retards
>>55091233
It doesn't matter as long as searching is O(n). Arrays are always faster. Modern CPUs can copy values in RAM with over 30GB/s speeds.
>>55091625
they can read ram with over 30GB/s too
>>55092122
For arrays, yes. And it's not due to the raw speed, but due to caching and string copy instructions. Lists don't enjoy these optimizations.
my data structures text says its in O(1). i'll believe the poo in loo