Mixed Questions on Bubble, Selection Sort and Binary Search Set 6

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. 6 in this series.

Last Reviewed and Updated on February 7, 2020
Posted by Parveen(Hoven),
Aptitude Trainer and Software Developer

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.


Your Score
Correct Answers:
Wrong Answers:
Unattempted:

Question 1

While implementing the bubble sort algorithm, how many comparisons are required to be performed in pass 1:
 A
n - 1
 B
n - 2
 C
n - 3
 D
None
Soln.
Ans: A

Question 2

Is it true that alphanumeric keys are usually converted into numeric keys before the hashing function can operate on them.
 A
False
 B
True
 C
unknown statement
 D
None
Soln.
Ans: B
Yes, it is true that alphanumeric keys are usually converted into numeric keys before the hashing function can operate on them.

Question 3

The worst case space complexity of selection sort is:
 A
O(n2)
 B
O(2n)
 C
O(n) total, O(1) auxiliary
 D
O(n log n)
Soln.
Ans: C

Question 4

The process of reversing the positions of two variables is called ____.
 A
Sorting
 B
Swapping
 C
Inserting
 D
Selecting
Soln.
Ans: B

Question 5

What is the following algorithm?
  1. Repeat steps 2 and 3 varying from 0 to n-1
  2. Find the index of the minimum value in a[k] to a[n-1] and store it in m
  3. Swap a[k] with a[m].
 A
Bubble Sort
 B
Selection Sort
 C
Shell Sort
 D
Insertion Sort
Soln.
Ans: A

Question 6

What is the order of growth of the bubble sort algorithm?
 A
Quadratic
 B
Linear
 C
log linear
 D
None
Soln.
Ans: A

Question 7

Which type of growth does the selection sort have
 A
quadratic order of growth
 B
linear order of growth
 C
loglinear order of growth
 D
none of them
Soln.
Ans: A

Question 8

What is the value of the following array after the second pass ?
 A
 B
 C
45,12,34,67,25,39
 D
None
Soln.
Ans: C

Question 9

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

Question 10

The time factor, when determining the efficiency of algorithm, is measured by
 A
Counting microseconds
 B
Counting the number of key operations
 C
Counting the number of statements
 D
Counting the kilobytes of algorithm
Soln.
Ans: B

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.