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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a null pointer assignment error? What are bus errors, memory faults, and core dumps?

1378


What is an arrays?

1028


List the different types of c tokens?

1010


Who developed c language?

1039


What is pointer and structure in c?

1073


Where register variables are stored in c?

909


Describe newline escape sequence with a sample program?

1071


What is keyword in c?

962


Is printf a keyword?

1157


What is c++ used for today?

1060


Design a program which assigns values to the array temperature. The program should then display the array with appropriate column and row headings.

2275


What is I ++ in c programming?

1059


write a program to concatenation the string using switch case?

2035


How was c created?

997


What is #include stdlib h?

1056