top | item 28981771

(no title)

skneko | 4 years ago

> E.g., correct usage of arrays vs. ArrayList.

Arrays vs lists is a thing in all languages, not Java. They just have different names (list, vector, sequence...)

discuss

order

kayodelycaon|4 years ago

I don’t think Ruby or Python have linked lists, only arrays.

mattnewton|4 years ago

Ruby and python only have an equivalent to Java’s “array list.” It’s not in the standard library, but you can trivially make linked list nodes yourself if the problem calls for it; I don’t remember encountering a need for the data structure over the built in array-list type outside of interview questions anyways.

skneko|4 years ago

ArrayList is not a linked list, it's an array-backed list like List in C# or other languages, like the name implies. Linked list is `java.util.LinkedList`.