Computer Science/Data structure (1) 썸네일형 리스트형 [자료구조/JAVA] - 링크드 리스트(Linked list) 링크드 리스트란? 링크드 리스트(linkedlist)는 각각의 데이터가 노드(Node)로 구성되어 연결이 되있는 구조이다. 각각의 노드는 데이터와 함께 다음노드(next)와 이전노드(prev)를 가지고 있다. 노드는 linkedlist에 객체를 추가하거나 삭제하면 앞뒤 링크만 변경되고 나머지 링크는 변경되지 않는다. 중간에 데이터를 추가하거나 삭제해도 밀리거나 당겨지는 현상이 없기에 ArrayList에 비해 데이터의 추가나 삭제가 용이하나, 인덱스가 없어 특정 요소에 접근하기 위해서는 순차 탐색이 필요로 해 오래 걸린다는 단점이 있고, 링크 필드로 인한 기억 공간이 많이 필요하다. 탐색/정렬을 많이 하는 경우는 배열을 사용하고 탐색/삭제를 많이 하는 경우에는 링크드 리스트를 사용하는 것이 좋다. Link.. 이전 1 다음