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 me..... please codes and flowchart plz turbo c lang po yan.....please asap response... 3. Make an astrology program. The user types in his or her birthday (month, day, and year as integer), and the program responds with the user’s zodiac sign, horoscope, and other information related to it. If the user’s birth year falls into a leap year, your program should display an appropriate message for it. NOTES: Conditional Statements: it should be with graphics
‘ C’ PROGRAME TO SHOW THE TYPE OF TRANGLE BY ACCEPTING IT’S LENGTH .
Why pointers are used?
What are qualifiers in c?
Explain how do I determine whether a character is numeric, alphabetic, and so on?
What are the advantages of using new operator as compared to the function malloc ()?
How can you increase the allowable number of simultaneously open files?
Explain what happens if you free a pointer twice?
Is there a built-in function in C that can be used for sorting data?
What is the difference between call by value and call by reference in c?
What is the heap?
What are the c keywords?
Why doesnt this code work?
What library is sizeof in c?
What is null pointer in c?