5
은이 기록됩니다 성공 알고리즘에 관한 SynchronizedRandomAccessList 개체하지만, 자신도 어떤 세부 사항을 작성하는 경우랜덤 액세스 목록을 조작하는 알고리즘은 언제 적용됩니까? 가능해, RandomAccess 마커 인터페이스 설명에서
컬렉션 클래스의 synchronisedList 방법에* <p>The best algorithms for manipulating random access lists (such as
* <tt>ArrayList</tt>) can produce quadratic behavior when applied to
* sequential access lists (such as <tt>LinkedList</tt>). Generic list
* algorithms are encouraged to check whether the given list is an
* <tt>instanceof</tt> this interface before applying an algorithm that would
* provide poor performance if it were applied to a sequential access list,
* and to alter their behavior if necessary to guarantee acceptable
* performance.
이 가능해, RandomAccess &에 대한 검사가있다.
public static <T> List<T> synchronizedList(List<T> list) {
return (list instanceof RandomAccess ?
new SynchronizedRandomAccessList<T>(list) :
new SynchronizedList<T>(list));
}
이 알고리즘은 언제 적용되며 어디에서 (네이티브 코드입니까?)? 예제
는'synchronizedList'는 정말 때 및 요청 메신저 알고리즘이 –
@OliCharlesworth ... 아니다, 데이터 구조를 생성하는 것 알고리즘이란? – Prateek
을 적용하는 알고리즘 ... 알고리즘에 대해 이야기, 맞아하지만 문서의 주석을 참조 –