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 the argument of a function in c?

1044


What are the types of pointers?

1106


Which node is more powerful and can handle local information processing or graphics processing?

1312


‘SAVEPOINT’ and ‘ROLLBACK’ is used in oracle database to secure the data comment. Give suitable examples of each with sql command.

2329


How can I read and write comma-delimited text?

1068


Why main function is special give two reasons?

1537


What is the difference between near, far and huge pointers?

1086


Write a C Program That Will Count The Number Of Even And Odd Integers In A Set using while loop

2147


process by which one bit patten in to another by bit wise operation is? (a) masking, (b) pruning, (c) biting, (d) chopping,

2419


p*=(++q)++*--p when p=q=1 while(q<=6)

1752


What is function prototype in c with example?

1068


What do you mean by dynamic memory allocation in c? What functions are used?

1159


How do you define a function?

1018


Can you think of a logic behind the game minesweeper.

2459


What is dynamic variable in c?

1025