-
Java API 분석__Set, HashSet, TreeSet, LinkedHashSet개발입문/자료구조 2017. 7. 25. 16:35
Set public interface Setextends Collection 순서에 상관없이, 어떤 데이터가 존재하는지를 확인하기 위한 용도로 많이 사용된다. 중복되는 것을 방지하고, 원하는 값이 포함되어 있는지를 확인하는 것이 주 용도이다. 1. HashSet: 순서가 전혀 필요없는 데이터를 해시 테이블 hash table 에 저장한다. Set 중에서 가장 성능이 좋다. 2. TreeSet: 저장된 데이터의 값에 따라서 정렬되는 셋이다. red-black 이라는 트리 tree 타입으로 값이 저장되며, HashSet 보다 약간 성능이 느리다. 3. LinkedHashSet: 연결된 목록 타입으로 구현된 해시 테이블에 데이터를 저장한다. 저장된 순서에 따라서 값이 정렬된다. 대신 성능이 이 셋 중에서 가장..
-
Java API 분석__Class ArrayList개발입문/자료구조 2017. 7. 24. 15:35
ArrayList public class ArrayList extends AbstractList implements List, RandomAccess, Cloneable, SerializableResizable-array implementation of the List interface. Implements all optional list operations, and permits all elements, including null. In addition to implementing the List interface, this class provides methods to manipulate the size of the array that is used internally to store the list..