NEW
Font size
WorksheetsDSA - Practice Quiz - 1
Total questions: 15
Worksheet time: 8mins
The number of swaps made by selection sort algorithm in each iteration is _________
1
N
N-1
depends on the input
The worst case complexity of linear search is _______
O(1)
O(logn)
O(n2)
O(n)
What is the best case time complexity of merge sort?
O(n^2)
O(n)
O(nlogn)
O(logn)
If the list has n numbers and the largest number has m digits, then the radix sort algorithm requires ____ passes to give the output.
mn
m/n
n
m
If the bubble sort algorithm gets a list in descending order as input, it will perform ________ number swaps.
maximum
minimum
1
0
The selection sort algorithm finds the largest element in the list and swap it with the last element. State true or false.
True
False
Which of the following algorithms work similar to the way in which the playing cards are sorted?
insertion sort
bubble sort
radix sort
quick sort
Identify the algorithm that uses divide and conquer method
Binary search
quick sort
merge sort
all the mentioned
The quick sort algorithm splits the list into equal halves in each and every partitioning. State true or false.
True
False
In the brute-force string matching algorithm, the number of characters by which the pattern will be shifted towards right on a mismatch is ______
1
n
0
None of the mentioned
Quadratic probing is an example of
Closed hashing
open hashing
Which of the following can not be the load factor in closed hashing?
0
-1
1
0.5
Identify the index at which the data element 15 will be stored in a hash table of size 7 when linear probing is used for collision resolution and if 8 and 22 are already inserted.
1
0
3
2
If the pattern is not found in the text, the string matching algorithm will return ____
-1
0
1
n
The merge sort algorithm divides the list into sub lists until we get a list with ____ number of elements.
2
1
even
equal
