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 |
In what areas do data structures are applied?
Can a stack be described as a pointer? Explain.
Why do we need sorting algorithms?
Write the disadvantages of separate chaining?
Why is hashmap faster than treemap?
Why quicksort is called quick?
Describe the height term in a tree.
What are different techniques for making hash function? Explain with example.
Explain implementation of deletion from a binary tree.
Is it possible to increase size of array?
What is a spanning tree?does the minimum spanning tree of a graph give the shortest distance between any 2 specified nodes?
Define a right-skewed binary tree?