[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
>Linked Lists
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 33
Thread images: 2
File: disgusting.png (1 MB, 1080x1080) Image search: [Google]
disgusting.png
1 MB, 1080x1080
>Linked Lists
>>
>>53366246
a staple of any non babby program, eat shit casual
>>
>>53366246
did babby fail his linked lists assignment?
>>
you don't need linkedlist to write wordpress themes, OP!
>>
If it makes you feel better linked lists won't be in any actual software engineering (maybe your interviews).

You should know your hashmaps well though
>>
>>53366246
<ul>              
<li><a href="#">Something1</a></li>
<li><a href="#">Something2</a></li>
<li><a href="#">Something3</a></li>
<li><a href="#">Something4</a></li>
</ul>

how fucking hard was that?
>>
>>53366594
kek
>>
>>53366594
hearty chuckle, me matey
>>
>not just using arrays for everything
efficiency yo
>>
>>53366624
In most situations I would say dynamic arrays are better than linked lists, but weird problems that involve removing from the front can sometimes give linked lists the edge
>>
>>53366624
>>53366656
Linkedlists > arrays when inserting/deleting many times

arrays > linkedlists when iterating over array many times, and for random access to array
>>
>>53366656
Remove from the back of the array instead. Linked Lists are pretty much never used in real life.
>>
>>53366691
Linked Lists are slower than Array Lists for pretty much any real world use case. The only reason they are taught is for learning how pointers/references work. But they are impractical in the real world.
>>
>>53366701
this. Linked lists are archaic
>>
What would you faggots even use linked lists for in the real world? I'm talking about any of you specifically, not everyone else in the industry because that's obvious
>>
>>53366701
Yes, which is why I said dynamic arrays (arraylists, vectors, etc) are almost better.

You aren't thinking through the problem deep enough; not all situations would work with "just removing from the back of the array" (queues are often implemented this way). Sometimes you need both.

Understanding linked lists is pretty important to understanding graphs, which are of course used everywhere. You could think of the inodes in your filesystem as an application of linkedlists
>>
>>53366701
>>53366759

You guys are forgetting that arrays have fixed sizes. You would have to realloc everytime times the size of the array or whatever everytime you hit the capacity. A linked list is just adding another pointer.

Also linked lists are an important part of other larger data structs like skip lists / graphcs / trees / tries etc

tldr know them.
>>
>>53366831
>>53366811
>>53366759
>>53366745
>>53366701
>>itt: people who have never used c++ stl
>>
>>53366811
I use them sometimes...when I'm teaching about Linked Lists.
>>
>>53366811
any graph or tree ever
>>
>>53366811
hashing collisions
>>
>>53366866
>auto goes in all fields
cool language you got there
>>
>>53366831
You can implement a dequeue with an array as well. You can easily understand graph theory without ever knowing a single thing about linked lists.

>>53366856
The cost of reallocing is constant when amoritized. Don't forget you are allocating memory for linked list pointers as well every time you are adding an element.
>>
File: spongebob_no.jpg (80 KB, 490x300) Image search: [Google]
spongebob_no.jpg
80 KB, 490x300
>>53366866

Have you ever used the stl? deques often use linkedlists as their underlying structure. unordered_maps often use linkedlists for chaining.
>>
>>53366913
>constant when amoritized
only if you resize in a geometric sequence
>>
>>53366925
Yes? We agree? I was posting that in reply to people who think linkedlists are irrelevant
>>
>>53366949
No fucking shit? Why would you use anything else?
>>
>>53366811
off the top of my head?

chaining in something like a hash map since probing is dumb as fuck.
>>
>>53366954
ah, misunderstood

>>53366913
You don't seem to believe in LLs: https://www.quora.com/What-is-the-application-of-linked-lists-in-data-structures
>>
>>53367028
I know what LLs are. I am saying they have no practical advantage compared to array based lists.
>>
Persistent data structures, faggots
>>
>>53366523
criminally underrated post
>>
Linked lists only make sense when the objects are FUCKHUGE. Otherwise shifting will be cheaper, when cache misses are considered.
Thread replies: 33
Thread images: 2

banner
banner
[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.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.