tim
11/03/2020, 10:53 AMval list = listOf(2,3,4)
val el = 1
val next = listOf(el) + list
Thoughts?cheapmon
11/03/2020, 11:05 AMtim
11/03/2020, 11:06 AMArkadii Ivanov
11/03/2020, 11:32 AMtim
11/03/2020, 1:48 PMcheapmon
11/05/2020, 12:23 PMElements List Deque
100 13082 3590
1000 8736 8034
10000 48796 36239
100000 360435 259785
1000000 6179680 3074326
10000000 200453048 49068629
As you can see, Deque
is a lot more efficient after a certain threshold.