ArrayList和LinkedList

ArrayList採用動態數組來存儲元素,數組初始容量爲10,當數組須要擴容時,則按照新容量=(舊容量*3)/2+1進行擴容。數組 ArrayList和LinkedList簡單區別:.net ArrayList採用動態數組來存儲元素,LinkedList採用鏈表方式存儲元素。 對於隨機訪問元素,ArrayList優於LinkedList。由於LinkedList要移動指針。 對於新增和刪除元素,L
相關文章
相關標籤/搜索