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

How do you define a function?

0 Answers  


What is n in c?

0 Answers  


What are the primitive data types in c?

0 Answers  


program to find middle element of linklist?

1 Answers   Huawei,


Explain what is the difference between functions getch() and getche()?

0 Answers  






What functions are in conio h?

0 Answers  


What is new line escape sequence?

0 Answers  


Explain the difference between structs and unions in c?

0 Answers  


What is %d called in c?

0 Answers  


What is the difference between CV and Resume ?

2 Answers  


hat is a pointer?

4 Answers   Assurgent,


Program to find the absolute value of given integer using Conditional Operators

6 Answers   N Tech,


Categories