Examlex

Solved

Suppose We Want to Write a Loop That Traverses a Doubly-Linked

question 15

Short Answer

Suppose we want to write a loop that traverses a doubly-linked circular linked list.Assume that each node has a prev and a next reference,and the list itself maintains a reference to a head node.What is wrong with this loop header?
for (Node curr = head;curr != head.prev;curr = curr.next)


Definitions:

Related Questions