?
Given below is the pseudocode of floyd's cycle detection algorithm. Which of the following best suits the blank?
Given below is the pseudocode of floyd's cycle detection algorithm. Which of the following best suits the blank?
Start traversing the linked list using two pointers
move one pointer with . . . . . . . .
if pointers meet at any node
{
loop exists in the linked list
}
else
{
linked list doesn’t have a loop
}
if pointers meet at any node
{
loop exists in the linked list
}
else
{
linked list doesn’t have a loop
}
Join the Discussion
Login to post a comment or share your explanation.
Login