There doesn't seem to be a LinkedList in the Kotli...
# getting-started
v
There doesn't seem to be a LinkedList in the Kotlin std library - any obvious alternatives?
s
Why isnt an ArrayList good enough ?
m
If you're on the JVM, then you can just use
java.util.LinkedList
.
v
Because I want the links between previous and next items without referring to array positions.
s
Kotlins
List
supports
ListIterator
also
I am not sure how you get previous / next without using that
r
Kotlin doesn't have any data structures in its stdlib, only convenience functions that use the default java data structures. So you'll be perfectly fine just using the standard java LinkedList.
k
Multiplatform though.
v
Having done some experiments, I'm pretty certain LinkedList isn't the right structure for my dataset either. Maybe a SortedSet... Or maybe I need to rethink the design!
k
That often ends up being the case!