Is there a class in java that implements only a single-linked list? How is the memory allocated for a single-linked list? Are the elements distributed randomly or in one block? And under ArrayList?

Closed due to the fact that the issue is too general for the participants Denis Bubnov , diraria , Cheg , αλεχολυτ , andreymal 15 Sep '17 at 14:04 .

Please correct the question so that it describes the specific problem with sufficient detail to determine the appropriate answer. Do not ask a few questions at once. See “How to ask a good question?” For clarification. If the question can be reformulated according to the rules set out in the certificate , edit it .

    1 answer 1

    There is no single-linked list implementation in the java collections. There is a collection that is implemented on the basis of a doubly linked list, this is LinkedList. But the ArrayList collection is based on an array, and for an array, memory is allocated in blocks.
    You can write your own implementation of a single-linked list, in this case, if you create a new collection item through the new operator, then there is no guarantee in which order these objects will be located in memory.