A directory of Objective Type Questions covering all the Computer Science subjects. Here you can access and discuss Multiple choice questions and answers for various compitative exams and interviews.

Discussion Forum

Que. Consider the following function to traverse a linked list.

void traverse(struct Node *head)
{
while (head->next != NULL)
{
printf("%d ", head->data);
head = head->next;
}
}

Which of the following is FALSE about above function?
a. The function may crash when the linked list is empty
b. The function doesn't print the last node when the linked list is not empty
c. The function is implemented incorrectly because it changes head
d. None of the above
Answer:The function is implemented incorrectly because it changes head
Confused About the Answer? Ask for Details Here
Know Explanation? Add it Here

Similar Questions: