I am trying to create a doubly linked list and trying to traverse it in both directions. The reverse direction is working fine but forward movement is not working? Please help.
By Not working I mean the code is not printing the linked list in forward direction. i.e. it should print 10 11 12 13 14 using function displayListForward().
But that is not happening.
It is only printing the last element.
Yes.
But I have done that only for once i.e. at the start of execution, head and node will be same. But in the function addNode, I am moving node forward without changing the heap.
Isn't that correct?
Shouldn't head ne pointing to the first node of linked list?