write an algorithm and a program to count the number of
elements in a circularly singly linked list
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 |
Is array name a pointer?
how to swap 4 number without using temporary number?
Write a program to identify if a given binary tree is balanced or not.
Why is C called a middle-level language?
Why ordinary variable store only one value
Write a factorial program using C.
the maximum length of a character constant can be a) 1 character b) 8 characters c) 256 chaacters d) 125 characters
how to create duplicate link list using C???
What is ctrl c called?
there is two conditions , 1. while using for loop for printing 1 to 50 no's simulteneous 2. while using printf functios for printing 1 to 50 no's simulteneous with or without using variables who will take more time for compiling and execution? explain in details with reason?
What is the difference between union and structure in c?
what is c?