The description of ArrayList and LinkList, what is wrong in the following statement?

The description of ArrayList and LinkList, what is wrong in the following statement?

A. LinkedeList and ArrayList both implement the List interface.
B. ArrayList is a variable-size array, while LinkedList is a two-way linked list.
C. LinkedList does not support efficient random element access
. D. Inserting or deleting an element in the middle of LinkedList means The remaining elements in this list will be moved; the cost of inserting or deleting an element in the middle of the ArrayList is fixed

Analysis: The
D option is just the opposite. The memory structure of Arraylist is an array. When the size of the array is exceeded, a new array is created, and the elements in the original array are copied. Its essence is a linear table stored sequentially. Insertion and deletion operations will cause subsequent element movement, which is inefficient, but random access efficiency is high

The memory structure of LinkedList is stored in a doubly linked list, and the insertion and deletion of the linked storage structure is efficient and does not need to be moved. However, random access is inefficient and needs to be accessed sequentially from the beginning to the back

Guess you like

Origin blog.csdn.net/weixin_44436675/article/details/112976237