wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

DSA Day 4

Total questions: 7

Worksheet time: 5mins

Name
Class
Date
1.

Which of these is not an application of a linked list?

a)

To implement file systems

b)

To implement file systems

c)

To implement non-binary trees

d)

Random Access of elements

2.

Which of the following is not a disadvantage to the usage of array?

a)

Fixed size

b)

There are chances of wastage of memory space if elements inserted in an array are lesser than the allocated size

c)

Insertion based on position

d)

Accessing elements at specified positions

3.

What is the time complexity of inserting at the end in dynamic arrays?

a)

O(1)

b)

O(n)

c)

O(logn)

d)

Either O(1) or O(n)

4.

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)

The size of array has to be pre-decided, linked lists can change their size any time.

e)

All of the above

5.

Which of the following sorting algorithms can be used to sort a random linked list with minimum time complexity?

a)

Insertion Sort

b)

Quick Sort

c)

Heap Sort

d)

Merge Sort

6.

What is the output of following function in which start is pointing to the first node of the following linked list 1->2->3->4->5->6 ?

a)

1 4 6 6 4 1

b)

1 3 5 1 3 5

c)

1 2 3 5

d)

1 3 5 5 3 1

7.

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