# Mixed Questions on Bubble, Selection Sort and Binary Search Set 4

## This is series of all the mixed questions on Selection Sort, Bubble Sort and Binary Search Algorithms. They are shuffled in random order. These are meant for those who are preparing for a job interview, and also for those who are preparing for exams like GATE Exam. This is quiz no. 4 in this series.

Last Reviewed and Updated on February 7, 2020

## Quiz Questions

Each question has four choices. More than one options can be correct. When you have finished the quiz, click the button at the end of the questions to view the result, and the solutions and answers.

### Question 1

Which type of data structure is used in binary search?
A
Tree
B
C
Array
D
None of them
Soln.
Ans: C

### Question 2

What is the best case efficiency of binary search?
A
O(n log n)
B
O(1)
C
O(log n)
D
O(n)
Soln.
Ans: B
The best case efficiency of binary search is O(1).

### Question 3

The best case performance of selection sort is
A
O(n2)
B
O(2n)
C
O(n)
D
O(n log n)
Soln.
Ans: A

### Question 4

In linear probing, sequential search for an empty position becomes very ___ ?
A
Easy
B
Time consuming
C
Medium
D
None of them
Soln.
Ans: B
In linear probing, sequential search for an empty position becomes very Time consuming.

### Question 5

Which of these are the basic steps for performing selection sort?
A
Find smallest element in unsorted portion from list or array.
B
Interchange the smallest element with the one at the front of the unsorted portion
C
Both a and b
D
None of the above
Soln.
Ans: C

### Question 6

Selection sort is suitable for which type of list.
A
Large
B
Small
C
Depends on elements
D
None
Soln.
Ans: B

### Question 7

For each i from 1 to n - 1, there are ____ exchanges for selection sort.
A
1
B
n - 1
C
n
D
None
Soln.
Ans: A

### Question 8

Which of the following is not a limitation of the binary search algorithm?
A
must use a sorted array
B
requirement of sorted array is expensive when a lot of insertion and deletions are needed
C
there must be a mechanism to access middle element directly
D
binary search algorithm is not efficient when the data elements are more than 1000.
Soln.
Ans: D
binary search algorithm is not efficient when the data elements are more than 1000.

### Question 9

The efficiency of the selection sort algorithm is same as that of the bubble sort algorithm.
A
False
B
True
C
Depends on list
D
None
Soln.
Ans: B
Because both have same order of growth.

### Question 10

In which of the following hashing method, you first divide the keys into parts and then add them to get the hash value.
A
Folding Method
B
Truncation Method
C
Mid square Method
D
Modular Method
Soln.
Ans: A
In Folding Method first divide the keys into parts and then add them to get the hash value.

## My C/C++ Videos on Youtube

Here is the complete playlist for video lectures and tutorials for the absolute beginners. The language has been kept simple so that anybody can easily understand them. I have avoided complex jargon in these videos.