When to use GlueList over ArrayList or LinkedList? [duplicate]

元气小坏坏 提交于 2019-12-29 07:17:49

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!