JAVA] 간과하는 ArrayList vs LinkedList


JAVA] 간과하는 ArrayList vs LinkedList

위는 ArrayList와 LinkedList 로 데이터의 추가,삭제,얻기 를 했을 때의 걸리는 시간이다. 그림에서 보다시피 LinkedList는 데이터의 추가와 삭제를 할때 빠르고 데이터를 얻을 때 느리다. LinkedList를 쓸 때는 요소에 대한 무작위 접근이 많지 않거나, 리스트에서 요소의 추가,삭제가 많을 때 사용하면 된다. The difference of their performance is obvious. LinkedList is faster in add and remove, but slower in get. Based on the complexity table and testing results, we can figure out when to use ArrayList or LinkedList. In brief, LinkedList should be preferred if:there are no large number of random access of ..........



원문링크 : JAVA] 간과하는 ArrayList vs LinkedList