wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Linked List

Total questions: 85

Worksheet time: 43mins

Name
Class
Date
1.

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.

2.

Nodes in a linked list contain two things

a)

Direction and a pointer

b)

Data and a pointer

c)

A Pointer and a reference

d)

A pointer and a node

3.

The situation when in a linked list Head==NULL

is

a)

Full

b)

Empty

c)

Half full

d)

saturated

4.

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

a)

83

b)

9

c)

27

d)

Error

5.

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;

6.

Which of the following statement is not correct?

a)

List is a linear structure

b)

There are 2 example of list, Array List & Linked List.

c)

Array List is not an example of List

d)

List contains a sequence of elements

7.

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

a)

12

b)

4600

c)

1600

d)

88

8.

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

9.

What is the operation of the below statements?

a)

Insert a new node to the front of a linked list

b)

Create a new node for a linked list

c)

Insert a new node to the end of the linked list

d)

Calculate the size of a linked list

10.

What is the operation of the below statements?

a)

Insert a new node to the front of a linked list

b)

Create a new node for a linked list

c)

Insert a new node to the end of the linked list

d)

Calculate the size of a linked list

11.

What is the operation of the below statements?

a)

Create a new node for a linked list

b)

Insert a new node to the front of a linked list

c)

Delete a new node from a linked list

d)

Insert a new node to the end of the linked list

12.

Which the following circular linked list

a)
b)
c)
13.

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

14.

The doubly linked list would have how many fields in a node?

a)

1

b)

2

c)

3

d)

4

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.

How many null pointers exists in a circular linked list?

a)

0

b)

1

c)

2

d)

3

17.

Which of this not about linked list ?

a)

A nonlinear collection of data elements

b)

It can be used to implement several other common abstract data types example stack, queue, tree

c)

It use more memory than arrays because of the storage used by their pointers.

d)

Each record of a linked list is often called an 'element' or 'node'

18.

Which the following circular linked list

a)
b)
c)
19.

What advantage does a linked list have over an array?

a)

A linked list can give you the data faster

b)

It is easier to use

c)

A linked list is not of a fixed size

d)

It's better

20.

What is the best and worst-case time complexity for searching for a value in a Linked List?

a)

O(1) and O(log n)

b)

O(1) and O(1)

c)

O(1) and O(n^2)

d)

O(1) and O(n)

21.

Nodes in a linked list contain two things

a)

Direction and a pointer

b)

Data and a pointer

c)

A Pointer and a reference

d)

A pointer and a node

22.

What is an advantage of using a linked list 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)

Both of these are true.

23.

How to delete node B

a)

head->next=TempPtr; delete TemPtr;

b)

delete TempPtr; head->next=TempPtr->next;

c)

head->next=TempPtr->next; delete TempPtr;

d)

delete head; head->next= TempPtr->next

24.

To display data of the linked list:

a)

LinkedList *ptr; while (ptr!=NULL){ cout<<ptr->data;}

b)

LinkedList *ptr; while(ptr!=NULL){ ptr=ptr->Next;cout<<ptr->Data};

c)

LinkedList *ptr; while(ptr!=NULL){ ptr=ptr->Next;}

d)

LinkedList *ptr; while(ptr!=NULL){ ptr=ptr->Next;cout<<ptr->Next;}

25.

What does the following function do for a given Linked List with first node as head?

a)

Prints all nodes of linked lists

b)

Prints alternate nodes of Linked List

c)

Prints alternate nodes in reverse order

d)

Prints all nodes of linked list in reverse order

26.

The situation when in a linked list START=NULL is

a)

underflow

b)

overflow

c)

list full

d)

saturated

27.

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

28.

Name the three functions of a stack data structure.

a)

push, pop, peek

b)

push, pop, pull

c)

push, pop, pow

d)

none of the above

29.

How many fields does the node of a singly linked list has?

a)

1

b)

2

c)

3

d)

4

30.

The doubly linked list would have how many fields in a node?

a)

1

b)

2

c)

3

d)

4

31.

Linked list data structure offers considerable saving in _____________

a)

a) Computational Time

b)

b) Space Utilization

c)

c) Space Utilization and Computational Time

d)

d) Speed Utilization

32.

The situation when in a linked list Head==NULL

is

a)

Full

b)

Empty

c)

Half full

d)

saturated

33.

Each node in a linked list has two

pairs of ………….. and ……………….

a)

Link field and information field

b)

Link field and avail field

c)

Avail field and information field

d)

Address field and link field

34.

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

a)

83

b)

9

c)

27

d)

Error

35.

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

a)

83

b)

9

c)

27

d)

Error

36.

What is the condition to check whether linked

list is empty

a)

Head->next==Null

b)

Head->next->next==Null

c)

temp->next==Null

d)

Head==Null

37.

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

38.

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

39.

Head->next->next will print what value

(a)  

40.

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;

41.

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

a)

34

b)

12

c)

88

d)

3

42.

In Linked List implementation, a node carries information regarding

a)

Data

b)

Link

c)

Data and Link

d)

None of the mentioned

43.

Which of the following is not the advantages of Array lists?

a)

Fast random access to the elements

b)

Easy to use

c)

Easy to program

d)

Size is fixed

44.

What is value in the temp -> next -> next-> data below?

a)

34

b)

88

c)

12

d)

3

45.

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

a)

12

b)

4600

c)

1600

d)

88

46.

struct node *current = start->next

what "current" will contain if it is 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

47.

What is the operation of the below statements?

a)

Insert a new node to the front of a linked list

b)

Create a new node for a linked list

c)

Insert a new node to the end of the linked list

d)

Calculate the size of a linked list

48.

What is the operation of the below statements?

a)

Insert a new node to the front of a linked list

b)

Create a new node for a linked list

c)

Delete a new node from a linked list

d)

Insert a new node to the end of the linked list

49.

Which of the following statement is not correct?

a)

List is a linear structure

b)

There are 2 example of list, Array List & Linked List.

c)

Array List is not an example of List

d)

List contains a sequence of elements

50.

What is the best and worst-case time complexity for searching for a value in a Linked List?

a)

O(1) and O(log n)

b)

O(1) and O(1)

c)

O(1) and O(n^2)

d)

O(1) and O(n)

51.

Linked List is a data structure that consists of sequence of nodes

a)

True

b)

False

52.

To display data of the linked list:

a)

LinkedList *ptr; while (ptr!=NULL){ cout<<ptr->data;}

b)

LinkedList *ptr; while(ptr!=NULL){ ptr=ptr->Next;cout<<ptr->Data};

c)

LinkedList *ptr; while(ptr!=NULL){ ptr=ptr->Next;}

d)

LinkedList *ptr; while(ptr!=NULL){ ptr=ptr->Next;cout<<ptr->Next;}

53.

What does the following function do for a given Linked List with first node as head?

a)

Prints all nodes of linked lists

b)

Prints alternate nodes of Linked List

c)

Prints alternate nodes in reverse order

d)

Prints all nodes of linked list in reverse order

54.

Which of this not about linked list ?

a)

A nonlinear collection of data elements

b)

It can be used to implement several other common abstract data types example stack, queue, tree

c)

It use more memory than arrays because of the storage used by their pointers.

d)

Each record of a linked list is often called an 'element' or 'node'

55.

What advantage does a linked list have over an array?

a)

A linked list can give you the data faster

b)

It is easier to use

c)

A linked list is not of a fixed size

d)

It's better

56.

What is the best and worst-case time complexity for searching for a value in a Linked List?

a)

O(1) and O(log n)

b)

O(1) and O(1)

c)

O(1) and O(n^2)

d)

O(1) and O(n)

57.

What is an advantage of using a linked list 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)

Both of these are true.

58.

In a circular linked list

a)

Components are all linked together in some sequential manner

b)

There is no beginning and no end

c)

Components are arranged hierarchically

d)

Forward and backward traversal within the list is permitted

59.

A linear collection of data elements where the linear node is given by means of pointer is called?

a)

Linked list

b)

Node list

c)

Primitive list

d)

None

60.

Which of the following operations is performed more efficiently by doubly linked list than by singly linked list?

a)

Deleting a node whose location in given

b)

Searching of an unsorted list for a given item

c)

Inverting a node after the node with given location

d)

Traversing a list to process each node

61.

In linked list each node contain minimum of two fields. One field is data field to store the data second field is?

a)

Pointer to character

b)

Pointer to integer

c)

Pointer to node

d)

Node

62.

The concatenation of two list can performed in O(1) time. Which of the following variation of linked list can be used?

a)

Singly linked list

b)

Doubly linked list

c)

Circular doubly linked list

d)

Array implementation of list

63.

Consider the following definition in c programming language


struct node

{

int data;

struct node * next;

}

typedef struct node NODE;

NODE *ptr;

Which of the following c code is used to create new node?

a)

ptr=(NODE*)malloc(sizeof(NODE));

b)

ptr=(NODE*)malloc(NODE);

c)

ptr=(NODE*)malloc(sizeof(NODE*));

d)

ptr=(NODE)malloc(sizeof(NODE));

64.

A variant of linked list in which last node of the list points to the first node of the list is?

a)

Singly linked list

b)

Doubly linked list

c)

Circular linked list

d)

Multiply linked list

65.

In doubly linked lists, traversal can be performed?

a)

Only in forward direction

b)

Only in reverse direction

c)

In both directions

d)

None

66.

What kind of linked list is best to answer question like “What is the item at position n?”

a)

Singly linked list

b)

Doubly linked list

c)

Circular linked list

d)

Array implementation of linked list

67.

A variation of linked list is circular linked list, in which the last node in the list points to first node of the list. One problem with this type of list is?

a)

It waste memory space since the pointer head already points to the first node and thus the list node does not need to point to the first node.

b)

It is not possible to add a node at the end of the list.

c)

It is difficult to traverse the list as the pointer of the last node is now not NULL

d)

All of above

68.

A variant of the linked list in which none of the node contains NULL pointer is?

a)

Singly linked list

b)

Doubly linked list

c)

Circular linked list

d)

None

69.

In circular linked list, insertion of node requires modification of?

a)

One pointer

b)

Two pointer

c)

Three pointer

d)

None

70.

Linked lists are not suitable to for the implementation of?

a)

Insertion sort

b)

Radix sort

c)

Polynomial manipulation

d)

Binary search

71.

Which of the following points is/are true about Linked List data structure when it is compared with array

a)

Arrays have better cache locality that can make them better in terms of performance

b)

It is easy to insert and delete elements in Linked List

c)

Random access is not allowed in a typical implementation of Linked Lists

d)

All of the mentioned

72.

What differentiates a circular linked list from a normal linked list?

a)

a) You cannot have the ‘next’ pointer point to null in a circular linked list

b)

b) It is faster to traverse the circular linked list

c)

c) You may or may not have the ‘next’ pointer point to null in a circular linked list

d)

d) Head node is known in circular linked list

73.

Consider a small circular linked list. How to detect the presence of cycles in this list effectively?

a)

A.) Keep one node as head and traverse another temp node till the end to check if its ‘next points to head

b)

B.) Have fast and slow pointers with the fast pointer advancing two nodes at a time and slow pointer advancing by one node at a time

c)

C.) Cannot determine, you have to pre-define if the list contains cycles

d)

D.) None of these

74.

What differentiates a circular linked list from a normal linked list?

a)

A.) You cannot have the ‘next’ pointer point to null in a circular linked list

b)

B.) It is faster to traverse the circular linked list

c)

C.) You may or may not have the ‘next’ pointer point to null in a circular linked list

d)

D.) All of these

75.

Which of the following application makes use of a circular linked list?

a)

A) Undo operation in a text editor

b)

B) Recursive function calls


c)

C) Allocating CPU to resources

d)

D.) None of the above

76.

In a circular linked list ----------------

a)

a.Components are all linked together in some sequential manner

b)

.b.There is no beginning and no end.

c)

c.Components are arranged hierarchically.

d)

d.Forward and backward traversal within the list is permitted.

77.

A variant of linked list in which last node of the list points to the first node of the list is?

a)

a.Singly linked list

b)

b.Doubly linked list

c)

c.Circular linked list

d)

d.Multiply linked list

78.

In circular linked list, insertion of node requires modification of?

a)

a.One pointer

b)

b.Two pointer

c)

c.Three pointer

d)

d.Requires no modification

79.

A ............. is a header list where the last node points back to the header node.

a)

A. rounded header list

b)

B. circular header list

c)

C. common header list

d)

D. forward header list

80.

The disadvantage in using a circular linked list is .......

a)

A. it is possible to get into infinite loop

b)

B. last node points to fist node.

c)

C. time consuming

d)

D. requires more memory space.

81.

How do you count the number of elements in the circular linked list?

a)

a)

public int length(Node head)

{

int length = 0;

if( head == null)

return 0;

Node temp = head.getNext();

while(temp != head)

{

temp = temp.getNext();

length++;

}

return length;

}

b)

b)

public int length(Node head)

{

int length = 0;

if( head == null)

return 0;

Node temp = head.getNext();

while(temp != null)

{

temp = temp.getNext();

length++;

}

return length;

}

c)

c)

public int length(Node head)

{

int length = 0;

if( head == null)

return 0;

Node temp = head.getNext();

while(temp != head && temp != null)

{

temp = head.getNext();

length++;

}

return length;

}

d)

d)

public int length(Node head)

{

int length = 0;

if( head == null)

return 0;

Node temp = head.getNext();

while(temp != head && temp == null)

{

temp = head.getNext();

length++;

}

return length;

}

82.

In Linked list implementation, a node carries information regarding _______.

a)

Link

b)

Data

c)

Link and Data

d)

None of the above

83.

A linked list in which the last node of Linked list points to the first is called a _________.

a)

Singly linked list

b)

Doubly linked list

c)

Circular linked list

d)

None of these

84.

A doubly linked list performs traversal in _________.

a)

Either direction

b)

Circular direction

c)

Any direction

d)

None of these

85.

Linked list data structure usage offers considerable saving in

a)

Space utilisation and computational time

b)

Space utilisation

c)

computational time