In my previous Linked List in Java tutorial, I showed you how to create Linked Lists and how to manipulate them.
In this tutorial, I will cover Double Ended Linked Lists which have a reference to the first and last link. I cover how a Doubly Linked List allows you to go backwards and forwards in a list. Then we take a look at Iterators.
Numerous other topics are covered and the code and video below will help you learn.
If you like videos like this, it helps to tell Google+ [googleplusone]
Code From the Video
I think that the insertAfterKey method needs to check the double link is not empty.
if (!isEmpty()) {}
else {
lastLink = theNewLink;
firstLink = theNewLink;
}
Thank you for the input 🙂
In the NeighborIterator class, ‘theNeighbors’and ‘currentNeighbor’ may be null and lead to NullPointerException in the constructor, hasNext(), remove()
Yes you are correct