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...


write an algorithm and a program to count the number of
elements in a circularly singly linked list



write an algorithm and a program to count the number of elements in a circularly singly linked lis..

Answer / rakesh soni

struct node
{
int info;
struct node *next;
};
main()
{
struct node *head,*temp;
// here insert the elements in circular link list & suppose
//head have the starting pointer of circular link list
//head is not null
int count =1;
temp=head;
while(temp->next!= head)
{
count++;
temp=temp->next;
}
printf(" No of Elements = %d",count);
}

Is This Answer Correct ?    12 Yes 14 No

Post New Answer

More C Interview Questions

Place the #include statement must be written in the program?

0 Answers  


Can we change the value of static variable in c?

0 Answers  


Do you know what are bitwise shift operators in c programming?

0 Answers  


What is main void in c?

1 Answers  


a c code by using memory allocation for add ,multiply of sprase matrixes

0 Answers  


How do I declare an array of N pointers to functions returning pointers to functions returning pointers to characters?

2 Answers  


what is stack , heap ,code segment,and data segment

0 Answers  


1.What is a Data Structure? Explain its need? 2.What is a Directed Graph? Write an algorithm to find whether a Directed Graph is connected or not? 3.Explain the process of converting a Tree to a Binary Tree.

4 Answers   Ignou, TCS,


What is graph in c?

0 Answers  


Is using exit() the same as using return?

0 Answers  


difference between c and c++?

2 Answers  


who developed c and why he developed c?

5 Answers  


Categories