Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


write an algorithm and a program to count the number of
elements in a circularly singly linked list



write an algorithm and a program to count the number of elements in a circularly singly linked lis..

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

Post New Answer

More C Interview Questions

main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }

0 Answers   Wilco,


Why can't I perform arithmetic on a void* pointer?

0 Answers  


Can you explain what keyboard debouncing is, and where and why we us it? please give some examples

0 Answers   CSC, Wipro,


Device an algorithm for weiler-atherton polygon clipping, where the clipping window can be any specified polygon

0 Answers  


How do shell structures work?

0 Answers  


What is a stream water?

0 Answers  


WRITE A PROGRAM IN C TO MULTIPLY TWO 2-D ARRAYS

4 Answers  


Explain what is the general form of a c program?

0 Answers  


What are the advantages of using linked list for tree construction?

0 Answers  


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); }

1 Answers   Wipro,


what type of errors are checked during compilation

3 Answers  


What is malloc calloc and realloc in c?

0 Answers  


Categories