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?



Go through this linked list concept.While traversing through the singly linked list sometimes the f..

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

Post New Answer

More C Interview Questions

Explain which function in c can be used to append a string to another string?

0 Answers  


What are formal parameters?

0 Answers  


write a program for size of a data type without using sizeof() operator?

22 Answers   HCL, IBM,


Who is invented by c?

24 Answers   Infosys, Mphasis,


You are given a string which contains some special characters. You also have set of special characters. You are given other string (call it as pattern string). Your job is to write a program to replace each special characters in given string by pattern string. You are not allowed to create new resulting string. You need to allocate some new memory to given existing string but constraint is you can only allocate memory one time. Allocate memory exactly what you need not more not less.

2 Answers   Microsoft,


What is FIFO?

3 Answers  


in any language the sound structure of that language depends on its a) character set, input/output function, its control structures b) character set, library functions, input/output functions its control structures c) character set, library functions, control sturctures d) character set, operators, its control structures

0 Answers  


What is difference between stdio h and conio h?

0 Answers  


What are linker error?

0 Answers  


Can you add pointers together? Why would you?

0 Answers  


what is a non volatile key word in c language?

1 Answers  


what is the difference between getch() and getche()?

7 Answers   Infosys,


Categories