SyntaxFix
Write A Post
Hire A Developer
Questions
Here's a hint, you have a graph of nodes in the linked list, and you always keep a reference to head which is the first node in the linkedList. next points to the next node in the linkedlist, so when next is null you are at the end of the list.