Examveda

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
}

A. same speed

B. one fourth the speed of another

C. twice the speed of another

D. thrice the speed of another

Answer: Option C


This Question Belongs to Data Structure >> Miscellaneous On Data Structures

Join The Discussion

Related Questions on Miscellaneous on Data Structures