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...

Go through this linked list concept.While traversing through
the singly linked list sometimes the following code snippet
"while(head != NULL)" is used and other times
"while(head->link != NULL)"is used(Here head is the pointer
pointing to the first node,node has two parts data part and
link part).What is the difference between head != NULL and
Head->link != NULL and in which situation are they used?

Answer Posted / hari

When you want to check the value of the first node or before
traversing the node, we have to check whether head node is
available in the Linked list, those times, the "head !=
NULL" will be checked.

While traversing, whether the next node is available or to
verify the current node is last node, those times, we used
to check head->link != NULL.

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how can I make sure that my program is the only one accessing a file?

1217


Explain Basic concepts of C language?

1146


pgm to find number of words starting with capital letters in a file(additional memory usage not allowed)(if a word starting with capital also next letter in word is capital cann't be counted twice)

2326


What is c mainly used for?

1053


Explain heap and queue.

1074


Explain how can you tell whether a program was compiled using c versus c++?

1099


What is NULL pointer?

1086


What are the ways to a null pointer can use in c programming language?

1132


What is the equivalent code of the following statement in WHILE LOOP format?

1295


What is the best way of making my program efficient?

1029


what is stack , heap ,code segment,and data segment

2690


is it possible to create your own header files?

1100


Where we use clrscr in c?

1128


Explain what are the advantages and disadvantages of a heap?

1085


What do you mean by invalid pointer arithmetic?

1068