yazılıdır: başarı algoritması ile ilgili SynchronizedRandomAccessList nesneyi ama onların da hiçbir ayrıntı oluşturursanızRasgele erişim listelerini işlemek için algoritmalar ne zaman uygulanır? RandomAccess işaretleyici arabirimi açıklamasında
toplama sınıfı synchronisedList yönteminde* <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 & bir çek var.
public static <T> List<T> synchronizedList(List<T> list) {
return (list instanceof RandomAccess ?
new SynchronizedRandomAccessList<T>(list) :
new SynchronizedList<T>(list));
}
Bu algoritma ne zaman uygulanır ve nerede (yerel bir koddur)? örneklerin
'synchronizedList' gerçekten zaman ve soran im algoritması –
@OliCharlesworth ... değil, bir veri yapısını oluşturur neler algoritma atıfta bulunuyorsunuz? – Prateek
uygulandığı bir algoritma ... algoritması hakkında konuşurken haklı, ama dokümanlar yorumu görmek –