ArrayList uses an array as its data structure for preserving elements, while LinkedList uses the data structure of the linked list. Both ArrayList and LinkedList are linear table lists. But LinkedList does not have random access capabilities, and ArrayList owns.
For a list of linked lists, first (1) We use the ready-made LinkedList class in the API for some analysis, and then (2) We use our own Java code to implement the corresponding method in the linked list and its linkedlist.
(1) Analysis and use of ready-made API interfaces
Defined as follows, similar to ArrayList.
New Linkedlist<string> ();
As mentioned earlier, LinkedList does not have random access, which means that if you want to delete an element, you need to find it from scratch until you find the element at the specified location and then delete it. Let's just imagine that if the element to be deleted is in the back of the list, then this traversal of the list is actually time-consuming. Of course, if it is a doubly linked list, then it is convenient to manipulate the data elements near the head and tail of the linked list, but the operation of the elements in the middle of the list is a bit laborious.
LinkedList class for the Java collection framework