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 ?
new_node=(struct node *)malloc((struct node)); | |
new_node=(struct node *)malloc(sizeof(struct node)); | |
new_node=(struct node)malloc(sizeof(struct node)); | |
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
None of these | |
Access the “data” field of 1st node | |
Access the “data” field of 2nd node | |
Access the “data” field of 3rd node |
Question 3 |
struct node *current = start->nextwhat "current" will contain if it is variable of type struct node ?
Data Field of 2nd Node | |
Address of 2nd Node | |
None of these | |
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
12 | |
15 | |
25 | |
30 |
Question 5 |
start = start->next; current = start->next;what will be the value of address field of current ?
3225 | |
2184 | |
5572 | |
5571 |
Once you are finished, click the button below. Any items you have not completed will be marked incorrect.
There are 5 questions to complete.