Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

DS- UNIT-1

Total questions: 20

Worksheet time: 11mins

Name
Class
Date
1.
What is meant by the time complexity of an algorithm?
a)
The amount of time required to solve a particular problem
b)
How difficult a problem is to solve
c)
How many lines of code are required to solve a problem
d)
How quickly a solution can be developed
2.

How do you measure of the time complexity?

a)

Big-O notation

b)

Big-N notation

c)

N notation

d)

Small-O notation

3.

What is the value of the postfix expression 6 3 2 4 + – *:

a)

1

b)

14

c)

74

d)

-18

4.

___ dynamic memory function allocates memory continually

a)

malloc()

b)

calloc()

c)

realloc()

d)

all of the above

5.

the size of the dynamically allocated arrays can't be increased while inserting an element

a)

ture

b)

false

6.

Which of the following sorting algorithm will use tree structure for sorting elements

a)

quick sort

b)

merge sort

c)

heap sort

d)

selection sort

7.

What is the problems with fixed array sizes?.

a)

Exceeding the maximum

b)

Use of For Loops

c)

Use of indexes to access the array

d)

None

8.
Which of the following is NOT an advantage of an array?
a)
Each value in the array is identified by a unique variable.
b)
Any item in an array can be efficiently obtained by its index.
c)
It is easy to iterate over the items in an array.
d)
Data is stored in an organized way.
9.
________________________ are used to create a multi dimensional array.
a)
Single round brackets
b)
Single square brackets
c)
Multiple squares brackets
d)
Single angled brackets
10.
___________ is an array that can increase in size during program execution.
a)
Single-dimensional array
b)
Two-dimensional array
c)
Multi-dimensional array
d)
Dynamic array
11.
In ________, two sets of sorted items are combined into a third.
a)
Insertion Sort
b)
Bubble Sort
c)
Selection Sort
d)
Merge Sort
12.

Which sorting algorithm is more efficient with longer lists of data?

a)

Merge Sort

b)

Bubble Sort

c)

Both

d)

Neither

13.

Which of the following is NOT a stable sorting algorithm in its typical implementation.

a)

Insertion sort

b)

Bubble sort

c)

Merge sort

d)

Quick sort

e)

None

14.

Identify the sorting algorithm that apply divide-and-conquer method.

a)

Linear Sort

b)

Merge Sort

c)

Heap Sort

d)

Binary Sort

15.

Suppose we are sorting an array of eight integers using quick sort, and we have just finished the first partitioning with the array looking like this:

2 5 1 7 9 12 11 10

Identify the correct statement?

a)

Neither the 7 nor the 9 is the pivot.

b)

The pivot could be either the 7 or the 9.

c)

The pivot is not the 7, but it could be the 9.

d)

The pivot could be the 7, but it is not the 9.

16.

Identify the types of sorting that used partition and exchange sort.

a)

Bubble sort

b)

Selection sort

c)

Quick sort

d)

Merge sort

17.
Which type of sort algorithm is this?
a)
Insertion
b)
Bubble
c)
Merge
18.

What is the worst-case complexity of Quick Sort?

a)

O(n2)

b)

O(n*log n)

c)

O(2*log n)

d)

O(n2)^2

19.

What is pseudocode?

a)

Another way to write an algorithm.

b)

Uses symbols to represent an algorithm

c)

source code

d)

binary code

20.

In heap sort , to sort the elements in ascending order which heap tree will be used

a)

min heap tree

b)

max heap tree

c)

min heap tree or max heap tree

d)

none