You are viewing a single comment's thread. Return to all comments →
Why do I get
0 0 0 0
After running following code
Node ptr = head; while (ptr != null) { System.out.print(ptr.data + "\t"); ptr = ptr.next; }
Also, printing head.data returns 0 :(
head.data
0
Can anybody explain this?
Seems like cookies are disabled on this browser, please enable them to open this website
Inserting a Node Into a Sorted Doubly Linked List
You are viewing a single comment's thread. Return to all comments →
Why do I get
After running following code
Also, printing
head.data
returns0
:(Can anybody explain this?