Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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



How can one find a cycle in the linked list? IF found how to recognize the cycle and delete that c..

Answer / riddle

I dont think answer #8 is any recursive verion .....

Is This Answer Correct ?    1 Yes 2 No

How can one find a cycle in the linked list? IF found how to recognize the cycle and delete that c..

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

Post New Answer

More Data Structures Interview Questions

What is the difference between file structure and storage structure?

0 Answers  


Does hashset allow duplicates?

0 Answers  


Does map extend iterable?

0 Answers  


simple algorithm for bubble sort?

1 Answers  


What is difference between arraylist and list?

0 Answers  


Write the procedure to convert general tree to binary tree?

0 Answers  


Is bucket sort a comparison sort?

0 Answers  


Write a program to insert an element and in the specific position in the array?

0 Answers  


What is the purpose of tochararray ()?

0 Answers  


What is dequeue operation?

0 Answers  


What is data structure in programming language?

0 Answers  


What are some of the best practices relating to the java collection framework?

0 Answers  


Categories