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 |
What is #pragma directive?how it is used in the program? what is its advantages and disadvantages?
Write a program in C for showing working of different logical operator in C. Your program should guide users with proper message/menu on the console.
code for bubble sort?
How can I delete a file?
Is c an object oriented programming language?
what is the coding of display the factorial of a number using array and function?
WAP to find that given no is small or capital
Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it?
#include<stdio.h> void main() { int a=10,b=20,c=30; printf("%d",scanf("%d%d%d",&a,&b,&c)); } what is the output for this?
I didn't count the ducks that I saw in line, but I do remember that one duck was in front of two ducks, another duck behind two ducks. How many ducks did I see?
why we need function pointers?
What is stack in c?