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
What is strcpy() function?
What are the general description for loop statement and available loop types in c?
Is anything faster than c?
How many main () function we can have in a project?
what are non standard function in c
What is new line escape sequence?
What is property type c?
What is a pointer in c?
How is null defined in c?
How to define structures? ·
What is the difference between typedef struct and struct?
What are the scope of static variables?
What is the scope of global variable in c?
Define circular linked list.
Differentiate between calloc and malloc.