Search Header Logo

Divide and Conquer

Authored by Prithi S

Computers

University

Used 22+ times

Divide and Conquer
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In the divide and conquer process, breaking the problem into smaller sub-problems is the responsibility of

Sorting/Divide

Conquer/Solve

Merge/Combine

Divide/Break

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Select the appropriate recursive call for QuickSort.(arr is the array, low is the starting index and high is the ending index of the array, partition returns the pivot element

public static void quickSort(int[] arr, int low, int high)

{

int pivot;

if(high>low)

{

pivot = partition(arr, low, high);

quickSort(arr, low, pivot-1);

quickSort(arr, pivot+1, high);

}

}

public static void quickSort(int[] arr, int low, int high)

{

int pivot;

if(high<low)

{

pivot = partition(arr, low, high);

quickSort(arr, low, pivot-1);

quickSort(arr, pivot+1, high);

}

}

public static void quickSort(int[] arr, int low, int high)

{

int pivot;

if(high>low)

{

pivot = partition(arr, low, high);

quickSort(arr, low, pivot);

quickSort(arr, pivot, high);

}

}

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the worst case complexity of QuickSort?

O(nlogn)

O(logn)

O(n)

O(n^2)

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Apply Quick sort on a given sequence 7 11 14 6 9 4 3 12. What is the sequence after first phase, pivot is first element?

6 4 3 7 11 9 14 12

6 3 4 7 9 14 11 12

7 6 14 11 9 4 3 12

7 6 4 3 9 14 11 12

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The best case behaviour occurs for quick sort is, if partition splits the array of size n into __________

n/2 : n/3

n/4 : 3n/4

n/2 : (n/2) – 1

n/4 : 3n/2

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A machine needs a minimum of 200 sec to sort 1000 elements by Quick sort. The minimum time needed to sort 200 elements will be approximately

60.2 sec

20 sec

45.54 sec

31.11 sec

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The running time of merge sort can be reccursively represented by

T(n)=2T(n/2)+n

T(n)=2T(n/4)+n

T(n)=4T(n/2)+n

T(n)=3T(n/2)+n

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?

Discover more resources for Computers