Velvet Star Monitor

Standout celebrity highlights with iconic style.

news

Is there any doubly linked list implementation in Java?

Writer Matthew Barrera

I see JDK implementation of LinkedList internally contains Node inner class, which contains the address to next and previous.

So my doubt isn't LinkedList in java a doubly linked list. If not, why?

And how to implement our own doubly linked list?

3

1 Answer

Yes, LinkedList is a doubly linked list, as the Javadoc mentions :

Doubly-linked list implementation of the List and Deque interfaces. Implements all optional list operations, and permits all elements (including null).

All of the operations perform as could be expected for a doubly-linked list. Operations that index into the list will traverse the list from the beginning or the end, whichever is closer to the specified index.

14

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy