Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Linked list 1

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

The situation when in a linked list Head==NULL

is

a)

Full

b)

Empty

c)

Half full

d)

saturated

2.

In the above image what will be printed when Head->next->data?

a)

83

b)

9

c)

27

d)

Error

3.

What is value in the head -> next -> next below?

a)

12

b)

4600

c)

1600

d)

88

4.

A linked list contains a list pointer variable _____that stores the address of the first node of the list.

a)

Head

b)

NULL

c)

NEXT

d)

LAST

5.

The last node of the singly-linked list contains__________.

a)

INFO

b)

NULL

c)

NEXT

d)

None of the above

6.

Which node’s data will be printed when


“temp =temp->next” is executed 3 times and the initial value of temp is temp=head

a)

Null

b)

9

c)

27

d)

46

7.

how many times should


“temp =temp->next” be executed in the image to get the value of "Null" when the initial value of temp is temp=head

a)

1

b)

2

c)

3

d)

4

8.

What is the time complexity to count the number of elements in the linked list?

a)

O(1)

b)

O(n)

c)

O(log n)

d)

none of these

9.

Each Node contain minimum two fields one field called data field to store data. Another field is of type _________.

A

a)

pointer to an integer

b)

pointer to a node

c)

pointer to a class

d)

pointer to a character

10.

What is the time complexity to adding an elements in front of the linked list?

a)

O(1)

b)

O(n)

c)

O(log n)

d)

none of these

11.

What advantage does a linked list have over an array?

a)

Size of the list doesn't need to be mentioned at the beginning of the program

b)

You can add or remove elements from the middle of the list.

c)

The linked list doesn't have a size limit

d)

All of these are true.

12.

Complete the code in the red column

a)

string info; int link;

b)

int info; NodeType link;

c)

int info; string link;

d)

int info; NodeType * link;

13.

struct node *current = start->next

what will "current" contain if it is a pointer to a variable of type struct node ?

a)

Address of 2nd Node

b)

Data Field of 2nd Node

c)

Address of 1st Node

d)

None of these

14.

How to delete node B?

a)

head->next=TempPtr; free(TemPtr);

b)

free(TemPtr); head->next=TempPtr->next;

c)

head->next=TempPtr->next;free(TemPtr)r;

d)

free(head); head->next= TempPtr->next

15.

How many times should


“temp =temp->next” be executed in the image to get the value of "Null" when the initial value of temp is temp=head

a)

1

b)

2

c)

3

d)

4

16.

The following are practical uses of linked lists (choose 1 or more)

a)

web browsers

b)

music player / playlist

c)

operating system scheduler

d)

blockchain

e)

word processing

17.

The situation when in a linked list START=NULL is

a)

underflow

b)

overflow

c)

list full

d)

saturated

18.

Circular Linked List the Address part of last node holds the address of

a)

First Node

b)

Null

c)

Intermediate Node

d)

None of the Above

19.

--------------------- is used to define a linked list in C Programming

a)

Arrays

b)

Structures

c)

Functions

d)

None

20.

Can we add a node in between two nodes in a singly and doubly linked list?

a)

Only in singly linked list

b)

Only in doubly linked list

c)

In both singly and doubly linked list

d)

No we can't add