Divide and Conquer MCQ Quiz - Objective Question with Answer for Divide and Conquer - Download Free PDF

Last updated on Apr 14, 2025

Latest Divide and Conquer MCQ Objective Questions

Divide and Conquer Question 1:

Which of the following is not a divide and conquer method

  1. Binary Search
  2. Merge Sort
  3. Quick Sort
  4. Heap Sort

Answer (Detailed Solution Below)

Option 4 : Heap Sort

Divide and Conquer Question 1 Detailed Solution

The correct answer is Heap Sort.

Key Points

  • Divide and Conquer is a fundamental algorithmic technique where a problem is broken down into smaller sub-problems, each of which is solved independently, and then the solutions to the sub-problems are combined to form the solution to the original problem.
  • Binary Search, Merge Sort, and Quick Sort are all classic examples of divide and conquer algorithms:
    • Binary Search: This algorithm works by dividing the search interval in half repeatedly until the target value is found or the interval is empty.
    • Merge Sort: This sorting algorithm divides the array into two halves, recursively sorts each half, and then merges the sorted halves to produce the final sorted array.
    • Quick Sort: This sorting algorithm selects a 'pivot' element and partitions the array into two sub-arrays according to whether elements are less than or greater than the pivot, then recursively sorts the sub-arrays.
  • Heap Sort, however, is not a divide and conquer algorithm. It is an efficient, comparison-based sorting algorithm that builds a heap data structure from the input data and then repeatedly extracts the maximum element from the heap to build the sorted array.

Additional Information

  • While Heap Sort is not a divide and conquer algorithm, it is still an efficient sorting algorithm with a time complexity of O(n log n) for both the average and worst cases.
  • Divide and conquer algorithms are widely used due to their ability to break complex problems into simpler sub-problems, making them easier to manage and solve.
  • Understanding the different types of algorithms and their characteristics is essential for choosing the right approach for a given problem.

Divide and Conquer Question 2:

Which of the following is NOT a step in the Divide and Conquer algorithm?

  1. Combine
  2. Conquer
  3. Divide
  4. More than one of the above
  5. None of the above

Answer (Detailed Solution Below)

Option 5 : None of the above

Divide and Conquer Question 2 Detailed Solution

Explanation of Divide and Conquer Algorithm Steps - halleshangoutonline.com

The correct answer is None of the above.

key-point-image Key Points

  • The Divide and Conquer algorithm consists of three main steps:
    • Divide: Break the problem into smaller subproblems that are similar to the original problem but smaller in size.
    • Conquer: Solve the subproblems recursively. If the subproblems are small enough, solve them directly.
    • Combine: Combine the solutions of the subproblems to form the solution of the original problem.
  • Each of the provided options (Combine, Conquer, and Divide) are indeed steps in the Divide and Conquer algorithm.

additional-information-image Additional Information

  • The Divide and Conquer strategy is widely used in algorithms such as Merge Sort, Quick Sort, and Binary Search.
  • It is a powerful tool for solving complex problems by breaking them down into simpler subproblems.
  • This approach helps in reducing the time complexity for many computational problems.
  • Using Divide and Conquer can lead to more efficient algorithms in terms of both time and space complexity.

Divide and Conquer Question 3:

Consider the following table:

 Algorithms

 Design Paradigms

 (P) Kruskal

 (i) Divide and Conquer

 (Q) Quicksort

 (ii) Greedy

 (R) Floyd-Warshall

 (iii) Dynamic Programming

 

Match the algorithms to the design paradigms they are based on.

  1. (P) ↔ (ii), (Q) ↔ (iii), (R) ↔ (i)
  2. (P) ↔ (iii), (Q) ↔ (i), (R) ↔ (ii) 
  3. (P) ↔ (ii), (Q) ↔ (iv), (R) ↔ (i) 
  4. (P) ↔ (i), (Q) ↔ (ii), (R) ↔ (iii) 
  5. (P) ↔ (ii), (Q) ↔ (i), (R) ↔ (iii) 

Answer (Detailed Solution Below)

Option 5 : (P) ↔ (ii), (Q) ↔ (i), (R) ↔ (iii) 

Divide and Conquer Question 3 Detailed Solution

  • Quick Sort algorithm is based on divide and conquer approach in which a pivot is element is selected and array is partitioned based on that pivot element.
  • Kruskal algorithm is a minimum spanning tree algorithm in which in every iteration, minimum weighted edge is found and then it is added to the construction of minimum spanning tree. Edges are added in increasing order of the edge weights. That’s why it is a greedy approach.
  • Floyd Warshall algorithm is based on the principle of dynamic programming. It is used to solve the all pair shortest path problem.

Divide and Conquer Question 4:

Consider the following table:

 Algorithms

 Design Paradigms

 (P) Kruskal

 (i) Divide and Conquer

 (Q) Quicksort

 (ii) Greedy

 (R) Floyd-Warshall

 (iii) Dynamic Programming

 

Match the algorithms to the design paradigms they are based on.

  1. (P) ↔ (ii), (Q) ↔ (iii), (R) ↔ (i)
  2. (P) ↔ (iii), (Q) ↔ (i), (R) ↔ (ii) 
  3. (P) ↔ (ii), (Q) ↔ (i), (R) ↔ (iii) 
  4. More than one of the above
  5. None of the above

Answer (Detailed Solution Below)

Option 3 : (P) ↔ (ii), (Q) ↔ (i), (R) ↔ (iii) 

Divide and Conquer Question 4 Detailed Solution

  • Quick Sort algorithm is based on divide and conquer approach in which a pivot is element is selected and array is partitioned based on that pivot element.
  • Kruskal algorithm is a minimum spanning tree algorithm in which in every iteration, minimum weighted edge is found and then it is added to the construction of minimum spanning tree. Edges are added in increasing order of the edge weights. That’s why it is a greedy approach.
  • Floyd Warshall algorithm is based on the principle of dynamic programming. It is used to solve the all pair shortest path problem.

Divide and Conquer Question 5:

Let Xij =I { zi is compared to zj in quick sort algorithm} is an indicator variable, and zi is the ith smallest number.

Which of the following sequence of the numbers give the X2,5 = 1?

Note: Assume that there is a divide and conquer quick sort algorithm and in partition algorithm the first element of the lists is taken as pivot-element.

  1. 40, 50, 10, 20, 30
  2. 10, 20, 50, 30, 40
  3. 40, 20, 10, 30, 50
  4. 30, 20, 10, 40, 50

Answer (Detailed Solution Below)

Option 2 : 10, 20, 50, 30, 40

Divide and Conquer Question 5 Detailed Solution

The correct answer is option 2.

Concept:

QuickSort is a Divide and Conquer algorithm. It picks an element as a pivot and partitions the given array around the picked pivot. There are many different versions of quickSort that pick pivot in different ways.

  • Always pick the first element as a pivot.
  • Always pick the last element as the pivot.
  • Pick a random element as a pivot.
  • Pick median as the pivot.

Here given, Assume that there is a divide and conquer quick sort algorithm and in the partition algorithm, the first element of the lists is taken as pivot-element.

Option 1: 40, 50, 10, 20, 30

False, Here the pivot element is 40. After running quick sort the sequence will be like 20, 50, 10, 40, 30. So the given sequence of the numbers X2,5 = 1 is not correct.

Option 2: 10, 20, 50, 30, 40

True, Here the pivot element is 10. After running quick sort the sequence will be like 10, 20, 50, 30, 40. So the given sequence of the numbers X2,5 = 1 is the correct sequence.

After the pivot is 20, it divides the sequence like 10, 20, 50, 30, 40. And X3,5 = 1

After the pivot is 50, it divides the sequence like 10, 20, 40, 30, 50.  And X4,5 = 1. So on.

Option 3: 40, 20, 10, 30, 50

False, Here the pivot element is 40. After running quick sort the sequence will be like 30, 20, 10, 40, 50. So the given sequence of the numbers X2,5 = 1 is not correct.

Option 4: 30, 20, 10, 40, 50

False, Here the pivot element is 30. After running quick sort the sequence will be like 10, 20, 30, 40, 50. So the given sequence of the numbers X2,5 = 1 is not correct.

Hence the correct answer is 10, 20, 50, 30, 40.

Additional InformationQuicksort:

The worst-case time complexity quicksort algorithm is O(n2) if the array is sorted.
T(n) = T(n-1) + cn

That's why randomized quick sort come to make time complexity O(N log N)
Randomized quicksort:
Randomized quicksort says instead of picking the pivot to be the first element what if pick my pivot to be a random element from my array A[p...r].

Top Divide and Conquer MCQ Objective Questions

A sorting technique is called stable if

  1. If it takes O(n log n) time
  2. It uses divide and conquer technique
  3. Relative order of occurrence of non-distinct elements is maintained
  4. It takes O(n) space

Answer (Detailed Solution Below)

Option 3 : Relative order of occurrence of non-distinct elements is maintained

Divide and Conquer Question 6 Detailed Solution

Download Solution PDF
  • A sorting algorithm is said to be stable if two objects with equal keys appear in the same order in sorted output as they appear in the input array to be sorted.
  • This means a sorting algorithm is called stable if two identical elements do not change the order during the process of sorting.
  • Some sorting algorithms are stable by nature like Insertion sort, Merge Sort, Bubble Sort, etc. and some sorting algorithms are not, like Heap Sort, Quick Sort, etc.

Explanation:

An unordered list contains n distinct elements. The number of comparisons to find an element in this list that is neither maximum nor minimum is

  1. Ɵ(n log n)
  2. Ɵ(n)
  3. Ɵ(log n)
  4. Ɵ(1)

Answer (Detailed Solution Below)

Option 4 : Ɵ(1)

Divide and Conquer Question 7 Detailed Solution

Download Solution PDF

Code:

#include
int main() {
int ary[10] = {250,1,9,7,3,4,5,21,15,19};
/if we take any 3 elemement from n distinct element in an array one of them would be neither maximum nor minimum.
int a = ary[0];
int b = ary[1];
int c = ary[2];
if((b > a && a >c) || (c > a && a > b)) 
printf("%d",a);
else if((a > b && b >c) || (c > b && b >a)) 
printf("%d",b);
else 
printf("%d",c);
}

Output: 9

9 is neither maximum nor minimum

Explanation:

Neither recursion nor iteration takes place in the above code, every statement in the above program takes a constant amount of time 

and hence order is θ (1)

Note All elements are distinct, select any three numbers and output 2nd largest from them. If in the same question 'distinct' keyword is not given, we will have to get 3 distinct elements and this would take O(n) time in the worst case. From these 3 distinct elements the middle element is neither minimum nor maximum. In this case it is O(n). We hope clear your doubt.

Let Xij =I { zi is compared to zj in quick sort algorithm} is an indicator variable, and zi is the ith smallest number.

Which of the following sequence of the numbers give the X2,5 = 1?

Note: Assume that there is a divide and conquer quick sort algorithm and in partition algorithm the first element of the lists is taken as pivot-element.

  1. 40, 50, 10, 20, 30
  2. 10, 20, 50, 30, 40
  3. 40, 20, 10, 30, 50
  4. 30, 20, 10, 40, 50

Answer (Detailed Solution Below)

Option 2 : 10, 20, 50, 30, 40

Divide and Conquer Question 8 Detailed Solution

Download Solution PDF

The correct answer is option 2.

Concept:

QuickSort is a Divide and Conquer algorithm. It picks an element as a pivot and partitions the given array around the picked pivot. There are many different versions of quickSort that pick pivot in different ways.

  • Always pick the first element as a pivot.
  • Always pick the last element as the pivot.
  • Pick a random element as a pivot.
  • Pick median as the pivot.

Here given, Assume that there is a divide and conquer quick sort algorithm and in the partition algorithm, the first element of the lists is taken as pivot-element.

Option 1: 40, 50, 10, 20, 30

False, Here the pivot element is 40. After running quick sort the sequence will be like 20, 50, 10, 40, 30. So the given sequence of the numbers X2,5 = 1 is not correct.

Option 2: 10, 20, 50, 30, 40

True, Here the pivot element is 10. After running quick sort the sequence will be like 10, 20, 50, 30, 40. So the given sequence of the numbers X2,5 = 1 is the correct sequence.

After the pivot is 20, it divides the sequence like 10, 20, 50, 30, 40. And X3,5 = 1

After the pivot is 50, it divides the sequence like 10, 20, 40, 30, 50.  And X4,5 = 1. So on.

Option 3: 40, 20, 10, 30, 50

False, Here the pivot element is 40. After running quick sort the sequence will be like 30, 20, 10, 40, 50. So the given sequence of the numbers X2,5 = 1 is not correct.

Option 4: 30, 20, 10, 40, 50

False, Here the pivot element is 30. After running quick sort the sequence will be like 10, 20, 30, 40, 50. So the given sequence of the numbers X2,5 = 1 is not correct.

Hence the correct answer is 10, 20, 50, 30, 40.

Additional InformationQuicksort:

The worst-case time complexity quicksort algorithm is O(n2) if the array is sorted.
T(n) = T(n-1) + cn

That's why randomized quick sort come to make time complexity O(N log N)
Randomized quicksort:
Randomized quicksort says instead of picking the pivot to be the first element what if pick my pivot to be a random element from my array A[p...r].

Consider the following table:

 Algorithms

 Design Paradigms

 (P) Kruskal

 (i) Divide and Conquer

 (Q) Quicksort

 (ii) Greedy

 (R) Floyd-Warshall

 (iii) Dynamic Programming

 

Match the algorithms to the design paradigms they are based on.

  1. (P) ↔ (ii), (Q) ↔ (iii), (R) ↔ (i)
  2. (P) ↔ (iii), (Q) ↔ (i), (R) ↔ (ii) 
  3. (P) ↔ (ii), (Q) ↔ (i), (R) ↔ (iii) 
  4. (P) ↔ (i), (Q) ↔ (ii), (R) ↔ (iii) 

Answer (Detailed Solution Below)

Option 3 : (P) ↔ (ii), (Q) ↔ (i), (R) ↔ (iii) 

Divide and Conquer Question 9 Detailed Solution

Download Solution PDF
  • Quick Sort algorithm is based on divide and conquer approach in which a pivot is element is selected and array is partitioned based on that pivot element.
  • Kruskal algorithm is a minimum spanning tree algorithm in which in every iteration, minimum weighted edge is found and then it is added to the construction of minimum spanning tree. Edges are added in increasing order of the edge weights. That’s why it is a greedy approach.
  • Floyd Warshall algorithm is based on the principle of dynamic programming. It is used to solve the all pair shortest path problem.

Consider a sequence of 14 elements: A = [−5, −10, 6, 3, −1, −2, 13, 4, −9, −1, 4, 12, −3, 0].

The subsequence sum \(S\left( {i,j} \right) = \mathop \sum \nolimits_{k = i}^j A\left[ k \right]\). Determine the maximum of S(i, j),

where 0 ≤ i ≤ j < 14. (Divide and conquer approach may be used.)

Answer (Detailed Solution Below) 29

Divide and Conquer Question 10 Detailed Solution

Download Solution PDF

Largest Sum Contiguous subarray is from index 2 to 11

Maximum subsequence sum = S(2, 11) = 6, 3, -1, -2, 13, 4, -9, -1, 4, 12 = 29

Code in C++ to find the maximum contiguous sum of array

#include

using namespace std;

int kadane(int arr[], int n)

{

int max_so_far = 0;

int max_ending = 0;

for (int i = 0; i < n; i++)

{

max_ending = max_ending + arr[i];

max_ending = max(max_ending, 0);

max_so_far = max(max_so_far, max_ending);

}

return max_so_far;

}

int main()

{

int arr[] = { −5, −10, 6, 3, −1, −2, 13, 4, −9, −1, 4, 12, −3, 0};

int n = sizeof(arr)/sizeof(arr[0]);

cout << "largest sum of contiguous sub-array is " << kadane(arr, n);

return 0;

}

What is the product of following matrix using Strassen's matrix multiplication algorithm?

\(A=\begin{bmatrix}1 & 3 \\\ 5 & 7 \end{bmatrix} \ \ \ \ B = \begin{bmatrix}8 & 4 \\\ 6 & 2 \end{bmatrix}\)

  1. C11 = 80 ; C12 = 07 ; C21 = 15 ; C22 = 34
  2. C11 = 82 ; C12 = 26 ; C21 = 10 ; C22 = 34
  3. C11 = 15 ; C12 = 07 ; C21 = 80 ; C22 = 34
  4. C11 = 26 ; C12 = 10 ; C21 = 82 ; C22 = 34

Answer (Detailed Solution Below)

Option 4 : C11 = 26 ; C12 = 10 ; C21 = 82 ; C22 = 34

Divide and Conquer Question 11 Detailed Solution

Download Solution PDF

Concept: 

  • Strassen’s matrix multiplication uses the divide and conquers approach. Divide both the matrices in 4 sub-matrices of size N/2 × N/2.
  • Perform 8 multiplications for matrices of size N/2 × N/2 and 4 additions. The addition of two matrices takes O(N2) time.

Hence recurrence relation is T(N) = 8T(N/2) + O(N2)

Calculation:

\(A=\begin{bmatrix}1 & 3 \\\ 5 & 7 \end{bmatrix} \ \ \ \ B = \begin{bmatrix}8 & 4 \\\ 6 & 2 \end{bmatrix}\)
\(AB=\begin{bmatrix}1 & 3 \\\ 5 & 7 \end{bmatrix} \begin{bmatrix}8 & 4 \\\ 6 & 2 \end{bmatrix} = \begin{bmatrix}1\times8+3\times6 & 1\times4+3\times2 \\\ 5\times8+7\times6 & 5\times4+7\times2 \end{bmatrix}\)
\(AB= \begin{bmatrix}26 & 10 \\\ 82 & 34 \end{bmatrix}\)
Therefore option 4 is correct

The minimum number of comparisons required to find the minimum and the maximum of 100

numbers is  ________

Answer (Detailed Solution Below) 148

Divide and Conquer Question 12 Detailed Solution

Download Solution PDF

Data:

n = 100

Formula:

minimum number of comparisons = \(\frac{{3n}}{2} - 2\)

Calculation:

minimum number of comparisons = \(\frac{{3\; \times \;100}}{2} - 2 = 148\)

Important Points:

Divide and conquer is used to achieve minimum comparison

Tournament Method Technique

1. To find the smallest element in the array will take n−1 comparisons = 100 – 1 = 99.

2. To find the largest element -

After the first round of Tournament, there will be exactly n/2 numbers = 50 that will lose the round.

So, the biggest looser (the largest number) should be among these 50 looser.

To find the largest number will take \(\frac{n}{2} - 1\) comparisons = 49.

Total 99 + 49 = 148.

Match the following and choose the correct answer for the order A, B, C, D.

A.

Strassen matrix multiplication

p.

Decrease and Conquer

B.

Insertion sort

q.

Dynamic Programming

C.

Gaussian Elimination

r.

Divide and Conquer

D.

Floyd shortest path algorithm

s.

Transform and Conquer

  1. r, s, p, q
  2. r, p, s, q
  3. q, s, p, r
  4. s, p, q, r

Answer (Detailed Solution Below)

Option 2 : r, p, s, q

Divide and Conquer Question 13 Detailed Solution

Download Solution PDF

Concept:

Strassen’s matrix multiplication:

  • It is a method used for matrix multiplication. It uses the Divide and Conquer approach to multiply the matrices.
  • Time consumption is improved by using Strassen’s method as compared to the standard multiplication method.
  • It is faster than the standard method. Strassen’s multiplication can be performed only on square matrices.

Insertion sort

Insertion sort is sorting algorithm which decreases the problem by 1. It uses the Decrease and Conque approach 

Gaussian elimination

It uses Transform and Conquer approach to solve a set of equations. 

Floyd Warshall 

Its algorithm is based on the principle of dynamic programming. It is used to solve the all pair shortest path problem.

Conclusion

Strassen matrix multiplication  → Divide and Conquer

Insertion sort  → Decrease and Conquer

Gaussian Elimination  →  Transform and Conquer

Floyd shortest path algorithm → Dynamic Programming

Which of the following is not a divide and conquer method

  1. Binary Search
  2. Merge Sort
  3. Quick Sort
  4. Heap Sort

Answer (Detailed Solution Below)

Option 4 : Heap Sort

Divide and Conquer Question 14 Detailed Solution

Download Solution PDF

The correct answer is Heap Sort.

Key Points

  • Divide and Conquer is a fundamental algorithmic technique where a problem is broken down into smaller sub-problems, each of which is solved independently, and then the solutions to the sub-problems are combined to form the solution to the original problem.
  • Binary Search, Merge Sort, and Quick Sort are all classic examples of divide and conquer algorithms:
    • Binary Search: This algorithm works by dividing the search interval in half repeatedly until the target value is found or the interval is empty.
    • Merge Sort: This sorting algorithm divides the array into two halves, recursively sorts each half, and then merges the sorted halves to produce the final sorted array.
    • Quick Sort: This sorting algorithm selects a 'pivot' element and partitions the array into two sub-arrays according to whether elements are less than or greater than the pivot, then recursively sorts the sub-arrays.
  • Heap Sort, however, is not a divide and conquer algorithm. It is an efficient, comparison-based sorting algorithm that builds a heap data structure from the input data and then repeatedly extracts the maximum element from the heap to build the sorted array.

Additional Information

  • While Heap Sort is not a divide and conquer algorithm, it is still an efficient sorting algorithm with a time complexity of O(n log n) for both the average and worst cases.
  • Divide and conquer algorithms are widely used due to their ability to break complex problems into simpler sub-problems, making them easier to manage and solve.
  • Understanding the different types of algorithms and their characteristics is essential for choosing the right approach for a given problem.

Which of the following algorithm design techniques is used in the quick sort algorithm?

  1. Dynamic programming
  2. Backtracking
  3. Divide and conquer
  4. Greedy method

Answer (Detailed Solution Below)

Option 3 : Divide and conquer

Divide and Conquer Question 15 Detailed Solution

Download Solution PDF

Concept:

Quick Sort is a Divide and Conquer algorithm. It picks an element as a pivot and partitions the given array.

Important Points:

  • Merge Sort is a Divide and Conquer algorithm. It divides the input array into two halves, calls itself for the two halves, and then merges the two sorted halves.
  • Both Merge Sort and quicksort are based on the divide and conquer method.
Get Free Access Now
Hot Links: teen patti club apk teen patti wala game teen patti - 3patti cards game downloadable content teen patti gold download apk teen patti cash