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 do you mean by a local block?
What is the process to create increment and decrement stamen in c?
Why static is used in c?
What is anagram in c?
Iam a B.Tech graduate and completed my engineering in 2009, from 2005 to 2009 and after that i had done nothing.Now i want to do job and get into BPO field . Friends give me suggestions as what to say in interview... if they ask me that what would you had done ... these many years without doing job ??????? pls urgent
How can I recover the file name given an open stream?
Differentiate between the = symbol and == symbol?
What are the 4 types of functions?
an expression contains relational operators, assignment operators, and arithmatic operstors. In the absence of parentheses, they will be evaluated in which of the following order a) assignment, relational, arithematic b) arithematic, relational, assignment c) relational, arithematic, assignment d) assignment, arithematic, relational
What is typedf?
What do you mean by Recursion Function?
Can a variable be both constant and volatile?
Can static variables be declared in a header file?
please send me the code for multiplying sparse matrix using c
Explain how can a program be made to print the line number where an error occurs?