Answer the question
In order to leave comments, you need to log in
LinkedList vs ArrayList single insert and insert in a loop in the middle?
I read that a one-time insertion into the middle is the same in both cases, but if you insert many elements into the middle in a loop, then the arraylist is slower than linkedList, but when checking through measureTimeMillis {}, the time is approximately the same shows which method you need to insert the elements to see the difference ?
Answer the question
In order to leave comments, you need to log in
Throw a million elements into the list in advance, and then insert the elements at the beginning - the effect will be immediately visible
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question