X636: loopInChain15
Consider the following class definition:
class Link{
Object data;
Link next;
}
p is a reference to the first node in a list L. Return a boolean which tells if the list has a loop in it (if the last node in the list points to the first node). Assume no data values are repeated. Make sure to account for edge cases! If the list is empty, return false.
True Case | False Case |
Your Answer:
Feedback
Your feedback will appear here when you check your answer.