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 |
Place the #include statement must be written in the program?
Can we change the value of static variable in c?
Do you know what are bitwise shift operators in c programming?
What is main void in c?
a c code by using memory allocation for add ,multiply of sprase matrixes
How do I declare an array of N pointers to functions returning pointers to functions returning pointers to characters?
what is stack , heap ,code segment,and data segment
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.
What is graph in c?
Is using exit() the same as using return?
difference between c and c++?
who developed c and why he developed c?