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 / 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 |
How do you define a function?
What is n in c?
What are the primitive data types in c?
program to find middle element of linklist?
Explain what is the difference between functions getch() and getche()?
What functions are in conio h?
What is new line escape sequence?
Explain the difference between structs and unions in c?
What is %d called in c?
What is the difference between CV and Resume ?
hat is a pointer?
Program to find the absolute value of given integer using Conditional Operators