How can one find a cycle in the linked list? IF found how
to recognize the cycle and delete that cycle?
Answers were Sorted based on User's Feedback
Answer / riddle
I dont think answer #8 is any recursive verion .....
| Is This Answer Correct ? | 1 Yes | 2 No |
Answer / rajdeep...
void cycle_detect(struct node *head)
{
struct node *ptr1=head;
struct node *ptr2=head;
while(ptr1!=NULL && ptr1->next!=ptr2)
{
ptr1=ptr1->next;
}
if(ptr1->next==ptr2)
{
printf("the list contains cycle");
}
else
{
printf("the list don't contain cycle");
}
}
| Is This Answer Correct ? | 6 Yes | 16 No |
What is array and its types?
Why is quicksort better than mergesort?
What is the difference between array and stack?
What is the difference between array and stack in data structures?
Explain implementation of deletion from a binary tree.
What are the types of binary tree?
What is the default capacity of hashmap?
How many types of linked lists are there?
What is the use of data structure?
Differentiate between failfast and failsafe.
Is array of data structure?
If you are using c language to implement the heterogeneous linked list, explain what pointer type will you use?