Wait, you're right. I was looking at some data for TreeSet by mistake.
Type: Posts; User: javapenguin
Wait, you're right. I was looking at some data for TreeSet by mistake.
I meant for accessing an ArrayList, it's 0(1) for any element.
LinkedList, for element n/2, it'd be O(n/2) or shortened to O(n)
Sorting is (at worst) O(log2(n)) for ArrayList
and O(n) for...
Also, ArrayList has to be in the same place in memory, just like arrays, (i.e. all the values in the ArrayList have to be right next to each other in memory.) That can cause you to have an...