Which of the following is the correct way to check if a linked list has a loop?
Check if the last node points to null.
Traverse through the list and check if the node’s next points back to a previous node.
Check if the nodes contain references to themselves.
There is no way to check for a loop.
This question is part of this quiz :
JavaScript Linked List