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 |
in ‘C’ language for Matrix Multiplication fails” Introspect the causes for its failure and write down the possible reasons for its failure.
What language is lisp written in?
Do you know the purpose of 'register' keyword?
HOW CAN ADD OUR FUNCTION IN LIBRARY.
Program to find the sum of digits of a given number until the sum becomes a single digit
Can math operations be performed on a void pointer?
What is the modulus operator?
c program to compute AREA under integral
What is typedef example?
Expand the following LKB BKL FFG
What is the right way to use errno?
1 1 1 1 2 1 1 3 3 1 1 4 6 4 1