问题
I came across new list implementation which called GlueList
I want to know when i should use over ArrayList or LinkedList.
回答1:
To be honest, if you cant decide after reading info at GlueList which states in few sentences why it is better (different) and even have benchmark to see the real values and also Big-O notation - you are not in position where you have to think about use "as effective as possible" list.
If you are not sure what to use, this rule is good enough :
Do I need to select items often based on their position like in array? Then use ArrayList.
Do I need add/remove items often in middle of array? Use LinkedList
PS : I did not use LinkedList for a long time, in most "usual" cases the ArrayList is better.
来源:https://stackoverflow.com/questions/33737669/when-to-use-gluelist-over-arraylist-or-linkedlist