Linked List MCQ : Guess the Output (Multiple Choice Questions)


Congratulations - you have completed Data Structure.

You scored %%SCORE%% out of %%TOTAL%%.

Your performance has been rated as %%RATING%%


Your answers are highlighted below.
Question 1
Consider the following linked list representation -
struct node {
      int data;
      struct node *next;
}start = NULL;
struct node *new_node;
Which of the following statement is used to create a node ?
A
new_node=(struct node *)malloc((struct node));
B
new_node=(struct node *)malloc(sizeof(struct node));
C
new_node=(struct node)malloc(sizeof(struct node));
D
new_node=(struct *)malloc(sizeof(struct node));
Question 2
struct node {
      int data;
      struct node *next;
}*start = NULL;
Consider the above representation and predict what will be printed on the screen by following statement ?
start->next->data
A
None of these
B
Access the “data” field of 1st node
C
Access the “data” field of 2nd node
D
Access the “data” field of 3rd node
Question 3
struct node *current = start->next
what "current" will contain if it is variable of type struct node ?
A
Data Field of 2nd Node
B
Address of 2nd Node
C
None of these
D
Address Field of 2nd Node
Question 4
Consider the following linked list and following linked list representation -
struct node {
      int data;
      struct node *next;
}*start = NULL;
what will be the value of following statement ?
start->next->next->next->data
A
12
B
15
C
25
D
30
Question 5
If start is pointing to first node of the linked list then consider the following statement -
start     = start->next;
current   = start->next;
what will be the value of address field of current ?
A
3225
B
2184
C
5572
D
5571
Once you are finished, click the button below. Any items you have not completed will be marked incorrect. Get Results
There are 5 questions to complete.