Divide and Conquer

Divide and Conquer

University

10 Qs

quiz-placeholder

Similar activities

C++ Searches and Sorts

C++ Searches and Sorts

University - Professional Development

15 Qs

Computer programming-Array

Computer programming-Array

University

10 Qs

PSD #3

PSD #3

University

15 Qs

Arrays in C (II yr 02.07.2020)

Arrays in C (II yr 02.07.2020)

University

10 Qs

DATA STRUCTURES QUIZ

DATA STRUCTURES QUIZ

University

15 Qs

ENT110 C Programming Quiz2

ENT110 C Programming Quiz2

University

10 Qs

C Program Array and strings

C Program Array and strings

University

10 Qs

Episode 12 DSA Thursdays Sorting Algo

Episode 12 DSA Thursdays Sorting Algo

University

15 Qs

Divide and Conquer

Divide and Conquer

Assessment

Quiz

Computers

University

Hard

Created by

Prithi S

Used 22+ times

FREE Resource

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

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?