>linked list
its better than arrays
>>59980716
>no index
dropped
It depends on use case
I swear to god if the tripfag !ruby senpai posts in this thread I will be so freaking mad
>>59980716
No, bit streams is the only data type needed.
>>59980716
Linked lists are fundamental in implementing different data structures, but on their own, they're actually pretty shit.
Their locality of reference is terrible.
>>59980752
*sqeaky weirdo voice
well AKTUALLY a linekd list is 0n^3 memory while a array is o@s too replace items and blah blah blah blah im in my first year of CS bachelors btw
>>59980757
Yes. Everyone should code only using bitstreams as their only data structure.
>>59980803
defnitely
>>59980733
>cant make a simple indexing function
>>59980891
bloat
>>59980716
>>59980767
Get b& avatarfag
>>59980935
thats not the same girl retard
You're such an attention starved flamboyant faggot OP
>>59980956
not an argument
>>59980968
but we arent arguing, sissy fag.
>>59980977
buttblasted array user with no arguments
>>59980978
perverted avatarfag lusting for cocks with no arguments.
>>59981003
not an argument
at what size is it a good idea to use arrays?
>>59981006
yeah, you being a cock lusting faggot cant be argued
>>59981010
yeah bc its not true baaka
>>59981017
but it is, you effeminate cocksucker.
>>59981008
About 9 inches
lmao
>>59980763
if that's true then why is lisp the best prgraooming language in the world?
You’ll never win any algorithm contest using a linked list. They’re far slower than arrays
>>59981278
it isnt abou winning algorithm contests its about aesthetics
This is what happens when your daddy neglects you gentlemen, look and learn...
>>59981278
>algorithm contests
>>59981334
lmao
>>59980716
>>59980767
>>59981292
I think we should all fap to her at least once to honour her life.
>>59980716
Linked lists only outperform arrays when it comes to data nodes that need to be swapped in and out randomly in the list frequently.
Otherwise, arrays are just contiguous blocks of RAM with known widths for the data nodes, so next to no calculations needed to iterate over a straight up array.
>>59980716
You
Can't
Sort
It
In the trash quick
>>59981503
>he doesnt have quick sort implemented for linked list
>>59981517
Not so fast that's for a linked list of integers not my fucked up objects
>>59981472
Who?
I have a question /g/ !!List<Character> list = Arrays.asList(array);
Tell me please what i just created in the code above? "ArrayList" or "LinkedList" ? Don't tell me "List" because it is just a interface.List<Character> list = new ArrayList<Character>(Arrays.asList(array)); // this is arraylist
List<Character> list = new LinkedList<Character>(Arrays.asList(array)); // this is linkedlist
>>59981517
that would be fucking slow
also
>what are cache lines
>>59981541
>array
>as list
what do you think
>>59981541
Array list desu
>implementing lists by hand
Even in C, you should be using libraries to work with lists or trees, not fucking with arrays by hand.
>>59981562
>>59981571
So default is ArrayList wow it makes a sense now. Thanks.
>>59980716
>>59980733
>>59980891
>>59981517
>>59981542
>>59981562
>>59981577
Who are you quoting?
>>59980716
>O(n) search
>cache misses
>O(n) for the last element in most implementations
There is almost no case where linked lists are useful.
>>59981923
lol retard
>>59981923
And I forgot to mention, O(n) fetching an item at an index. Absolutely useless
If you really want a linked-list-based structure check out skip lists.
>>59981931
Nice arguments ;)
>>59981958
whats a skip list
desu i just like writing and using linked list functions alot more than array ones
linked list is only cool because it's literally the first data structure you learn and the only one you know
arrays are more flexible and can be used to implement a linked list if required
>array fags need the tail of the array
>creates an entire new array
meanwhile, in lists, all you need is to drop the first element
>>59981967
>whats a skip list
This fun thing
https://en.wikipedia.org/wiki/Skip_list
>desu i just like writing and using linked list functions alot more than array ones
Just make an abstraction that can work with both Arrays and Linked lists. You have read your SICP, haven't you?
>>59981978
The first data structure that I implemented was a double linked list ;_;
>>59980891
>O(n)
>>59982006int *
tail (int *x)
{
return x + 1;
}
???
>>59982019
im talking immutable arrays
functional programming is the future, and this overused meme of pointers is long begone
arrays are only useful for O(1) access with index
>>59982032
>im talking immutable arrays
Yes, what with them? The same thing applies.
>>59982041
procedural/imperative programming can't be used
>>59982008
thats pretty cool
>>59982054
Sure, just do it in a functional language.
Again, what is the problem?
Also, the following could be valid in a functional programming languageconst int *
tail (const int *x)
{
return x + 1;
}
No mutable state and no IO.
>>59980716
only if you're doing random inserts/deletes
ared lisp lists faster than haskell lists?
>>59982095
No because both of them are programming languages, not implementations.
>>59982104
are sbcl lists faster than ghc lists?
gcc lists vs clang
just look at the atnime girl <--
>>59982132
Neither of them provide linked lists to the user applications.
>>59982156
what about javascript double o(n log) aray links
>>59982171
idk mane, nobody uses javaschit anymore
>>59982206
dam u doxed me!11!
>>59982232
suck my cock
>>59982232
I guess we can agree that he is best artist
>>59982259
they're perfect
>>59980716
Linked lists when you don't know how much data you have and resize a lot, when you need to insert and delete valuers a lot and don't need fast access to elements.
Arrays when the size stays more or less the same and you have a lot of read/write operations or need searching and sorting a lot.
>I have a matrix which gets initialized once and then used for lookup operations a lot of times
Use an array
>I need to store incoming requests, but sometimes those requests get deleted again before I process them
Use a linked list
Also there are much more data structures, sometimes you want an Array-List, a doubly-linked list, a Red-Black-Tree, a Radix tree...
>>59982054
FYI, Haskell's vector and array libraries have O(1) slice operations, for both immutable and mutable arrays/vectors.
(tfw took the bait)
>>59982347
>Java
>>59980716
Linked lists for fast push/pop
Array lists for searching for a specific index
Hash map for storing more than one set of data into an array
Use what you need.
>>59982516
>Linked lists for fast push/pop
But you can implement that easily with an ArrayList.
Linked lists are for inserts/deletes at arbitrary indices.
>not just using really big structs
>>59982206
>>59980716
GOD BLESS ANIME FOOTPUSSY
>>59982557
>ArrayList
No such thing.
>>59982894
Call it a vector if you want to split hairs.
nice b8 m8
program more and read some more books, fa/g/
>>59981542
>doesn't know how to implement quick sort to linked lists efficiently
Lmao at your life
This is why I come to /g/
>>59982016
Just because indexing is built into other languages doesn't mean it isn't O(n)
>>59980716
>O(n) indexing
>fragmented in memory causes cache misses
No