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?



Go through this linked list concept.While traversing through the singly linked list sometimes the f..

Answer / 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

More C Interview Questions

Why do we use pointer to pointer in c?

0 Answers  


write a program for 7*8 = 56 ? without using * multiply operator ? output = 56

6 Answers   Xavient,


What is a structure in c language. how to initialise a structure in c?

0 Answers  


Why is #define used?

0 Answers  


HOW DO YOU HANDLE EXCEPTIONS IN C?

2 Answers   AppLabs,






write a program to compare 2 numbers without using logical operators?

5 Answers   IBM,


What are the back slash character constants or escape sequence charactersavailable in c?

0 Answers  


write a C program: To search a file any word which starts with ?a?. If the word following this ?a? starts with a vowel.Then replace this ?a? with ?a? with ?an?. redirect with the output onto an output file.The source file and destination file are specified by the user int the command line.

0 Answers   Subex,


Tell me what are bitwise shift operators?

0 Answers  


12345 1234 123 12 1

2 Answers  


What is the correct declaration of main?

0 Answers  


int i =10 main() { int i =20,n; for(n=0;n<=i;) { int i=10 i++; } printf("%d", i);

6 Answers   HCL, Octal, SW,


Categories