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 |
main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }
Why can't I perform arithmetic on a void* pointer?
Can you explain what keyboard debouncing is, and where and why we us it? please give some examples
Device an algorithm for weiler-atherton polygon clipping, where the clipping window can be any specified polygon
How do shell structures work?
What is a stream water?
WRITE A PROGRAM IN C TO MULTIPLY TWO 2-D ARRAYS
Explain what is the general form of a c program?
What are the advantages of using linked list for tree construction?
2.Given the short c program that follows a. make a list of the memory variables in this program b.which lines of code contain operations that change the contents of memory? what are those operations? Void main( void) { Double base; Double height; Double area; Printf(“enter base and height of triangle :”); Scanf(“%lg”, &base); Scanf(“%lg”, &height); Area=base*height/2.0; Printf(“the area of the triangle is %g \n”,area); }
what type of errors are checked during compilation
What is malloc calloc and realloc in c?