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
application attempts to perform an operation?
What should malloc() do? Return a null pointer or a pointer to 0 bytes?
Add Two Numbers Without Using the Addition Operator
a construct the"else" part of "if" statement contains anoth "if else" statement is called a) if-else b) else-if-else c) if-else-if-else d) chain if/if-else-if
How do I convert a string to all upper or lower case?
What is sorting in c plus plus?
Who is the founder of c language?
Do you know what are bitwise shift operators in c programming?
When is a “switch” statement preferable over an “if” statement?
7-Given an index k, return the kth row of the Pascal's triangle. For example, when k = 3, the row is [1,3,3,1]. For reference look at the following standard pascal’s triangle.
Write a program to compute the similarity between two strings - The program should get the two strings as input - Then it will output one single number which is the percentage of similarity between the two strings
What is the use of #define preprocessor in c?
Explain how do I determine whether a character is numeric, alphabetic, and so on?
Why we use conio h in c?
why arguments can generally be passed to functions a) sending the values of the arguments b) sending the addresses of the arguments c) a & b d) none of the above