Hello,
I have finished reading Lesson 15 on Linked Lists. There are some questions to ask about the code given in Lesson 15.
The first is this section of code:
struct node
{
int x; node *next;
};
For the *next pointer, is it in charge of pointing to another node? In Linked Lists, a node means another identical structure right?
The second ques is this section of code:
root->next = NULL;
Is it compulsary to initialize the pointer of the first node to NULL each time?
The third question:
while(conductor->next != NULL)
conductor = conductor -> next;
Earlier on, the conductor pointer points to root (the first node). And the *next pointer was already set to NULL earlier. So it seems that the while loop will never run at all. Is this correct?
Besides, what does this entire while loop do? I am still not so sure even after reading the Lesson explanations.
Lastly, what is the whole idea of Linked Lists? Is it a continuous replication of a structure until a NULL is encountered?
That's all......the question is rather long but thanks for your time.
Please reply quickly if you can......thanks![CODE]