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
Explain how can I make sure that my program is the only one accessing a file?
Explain Basic concepts of C language?
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)
What is c mainly used for?
Explain heap and queue.
Explain how can you tell whether a program was compiled using c versus c++?
What is NULL pointer?
What are the ways to a null pointer can use in c programming language?
What is the equivalent code of the following statement in WHILE LOOP format?
What is the best way of making my program efficient?
what is stack , heap ,code segment,and data segment
is it possible to create your own header files?
Where we use clrscr in c?
Explain what are the advantages and disadvantages of a heap?
What do you mean by invalid pointer arithmetic?