[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y / ] [Home]
4chanarchives logo

There are people here who can't accept that insertion into a linked list is


Thread replies: 18
Thread images: 1

File: Linked List.png (6KB, 474x116px) Image search: [Google] [Yandex] [Bing]
Linked List.png
6KB, 474x116px
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
Thread replies: 18
Thread images: 1
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y / ] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
If a post contains illegal content, please click on its [Report] button and follow the instructions.
This is a 4chan archive - all of the content originated from them. If you need information for a Poster - you need to contact them.
This website shows only archived content and is not affiliated with 4chan in any way.
If you like this website please support us by donating with Bitcoin at 1XVgDnu36zCj97gLdeSwHMdiJaBkqhtMK