## 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.

Correct Answers: | |

Wrong Answers: | |

Unattempted: |

### Question 1

______ is a specialization of selection sort.

**A**

quick sort

**B**

strand sort

**C**

selection sort

**D**

bingo sort

**Soln.**

**Ans: D**

Bingo sort is a variant of selection sort that orders items by repeatedly looking through remaining items to find the greatest value and moving all items with that value to their final location. This is more efficient if there are many duplicate values.

### 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 occurrence of collision can be ______ by using a good hash function.

**A**

Maximized

**B**

Minimized

**C**

Maximized as well as minimized

**D**

none of them.

**Soln.**

**Ans: B**

The occurrence of collision can be

*minimized*by using a good hash function.### Question 4

Which of the following are examples of binary search?

**A**

Number guessing game

**B**

Word lists

**C**

Applications to complexity theory

**D**

All of them

**Soln.**

**Ans: D**

All are the examples of binary search.

### Question 5

To Implement _________ Search algorithm, the list should be sorted

**A**

Binary Search

**B**

Both

**C**

Linear Search

**D**

none of them

**Soln.**

**Ans: A**

Binary Search algorithm is based on the preceding approach for searching an item in a sorted list.

### Question 6

In Quadratic probing when increasing the distance between the search location which problem is decreased?

**A**

Clustering

**B**

Clubbing

**C**

Clouding

**D**

Computing

**Soln.**

**Ans: A**

In Quadratic probing when increasing the distance between the search location decreases the problem of clustering.

### Question 7

Consider the following lists of partially sorted numbers. The double bars represent the sort marker. For each list state how many comparisons and swaps are needed to sort the next number

List 1→ [1, 3, 4, 6, 7 ||9, 8] List 2→[1, 2, 4, 5, 8 || 9]

**A**

1 comparison, 1 swap

0 comparisons, 0 swaps

0 comparisons, 0 swaps

**B**

1 comparison, 2 swap

1 comparisons, 0 swaps

1 comparisons, 0 swaps

**C**

2 comparison, 2 swap

0 comparisons, 0 swaps

0 comparisons, 0 swaps

**D**

None of the above

**Soln.**

**Ans: A**

### Question 8

What is the worst case complexity of binary search?

**A**

O(n log n)

**B**

O(1)

**C**

O(log n)

**D**

O(n)

**Soln.**

**Ans: B**

The worst case complexity of binary search is O(1).

### Question 9

Which of these methods are used for resolving collision processing?

**A**

Chaining

**B**

Open addressing

**C**

both A and B

**D**

None of them.

**Soln.**

**Ans: C**

- Chaining
- Open addressing

### Question 10

Open Address hashing does not include?

**A**

Linear probing

**B**

Quadratic probing

**C**

Double Hashing

**D**

Separate Chaining

**Soln.**

**Ans: D**

Separate Chaining is not included in open address hashing

## 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.