JavaScript | Linked List | Question 9

Last Updated :
Discuss
Comments

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.

Share your thoughts in the comments