C
C#17mo ago
Despy()

❔ when is it appropriate to use a linked list over a normal list ?

Ive been bumping my head on linked lists for a day now, not really focusing on studying linked lists but ive looking at others use them and such so my question is, when should i use linked lists of normal lists?
10 Replies
Cattywampus
Cattywampus17mo ago
If you need for the data to be sequentially accessed then LinkedList, otherwise List 99.99% you'd want List over LinkedList
Despy()
Despy()17mo ago
so, linked list if the data inside it is like, structured in a way thats good to be accessed sequentially as u said thats all ?
phaseshift
phaseshift17mo ago
basically never
Despy()
Despy()17mo ago
💀
phaseshift
phaseshift17mo ago
Unless you're using massive lists, and also doing many inserts, then maybe.
Despy()
Despy()17mo ago
alright got it then thanks
LPeter1997
LPeter199717mo ago
As always, I'll link my favorite Jason Turner talk: https://www.youtube.com/watch?v=uzF4u9KgUWI It's C++, but the thing about linked list vs sequential containers is basically the same. The TL;DR is, he measured the difference in one of his bigger project (Chai Script), where he used linked lists where he thought it made sense. The end result: there's no linked list anymore in the codebase
phaseshift
phaseshift17mo ago
That's also what I was basing my opinion off of 😁 I just forgot who did the talk
LPeter1997
LPeter199717mo ago
One of the biggest c++ legends who's actually very interactive with the community and doesn't just live in the committee ofc 😉
Accord
Accord17mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server
More Posts
✅ Event-like event for ReadKeywith Console.ReadKey, the entire program waits for an input before continuing. is there a way to hav✅ Outputting values from a listWhen typing in name and age it doesnt display the correct values. Instead it outputs: Program+PersonForcing user to choose 1, 2 or 3Hello, im a bit lost! first is a while-loop to make sure input is not null, but then how would I bes✅ Storing JSON and User data in a multi-tenant applicationHello! I'm developing a multi-tenant (multiple concurrent users) application. I require a database f❔ Deploying a dotnet core application with DockerI'm mostly used to building NodeJS applications where during development, I keep all "secrets" and a✅ Regex which matches strings containing things other than specific patternsThis is probably a very weird question (and also isn't strictly related to C#). I need a regex which❔ Is saving data from DB into private fields is a good idea?Lets say i have this class: ``` public class LessonAppService :ApplicationService, ILessonServi❔ .net 7, net 7.0.3 compatibility issues? in dockerI have following issue: i'm trying to run my application in docker, but it complains that i have no ❔ Binding a list<tuple<string,bool> to a form with switches in asp.netdoes anyone know how I can send a list of tuple string bool to a mvc page and display a checkbox in❔ Checking if ISymbol was autogeneratedHello, is there any way to check if `ISymbol` was autogenerated by c# compiler? In this case checkin