
Divide and Conquer

Quiz
•
Computers
•
University
•
Hard
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
Similar Resources on Wayground
15 questions
Coding club Summit Online Quiz

Quiz
•
University
15 questions
AS Computing: Data Structures

Quiz
•
10th Grade - University
10 questions
C Program Array and strings

Quiz
•
University
10 questions
Weekly Contest #3 - TechXNinjas

Quiz
•
University
10 questions
Tes Awal Modul 4

Quiz
•
University
10 questions
Kuis 3 - ASD - A

Quiz
•
University
10 questions
Arrays in C (II yr 02.07.2020)

Quiz
•
University
12 questions
Chapter 2-1: Array Part 1

Quiz
•
University
Popular Resources on Wayground
55 questions
CHS Student Handbook 25-26

Quiz
•
9th Grade
10 questions
Afterschool Activities & Sports

Quiz
•
6th - 8th Grade
15 questions
PRIDE

Quiz
•
6th - 8th Grade
15 questions
Cool Tool:Chromebook

Quiz
•
6th - 8th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
20 questions
Bullying

Quiz
•
7th Grade
18 questions
7SS - 30a - Budgeting

Quiz
•
6th - 8th Grade
Discover more resources for Computers
36 questions
USCB Policies and Procedures

Quiz
•
University
4 questions
Benefits of Saving

Quiz
•
5th Grade - University
20 questions
Disney Trivia

Quiz
•
University
2 questions
Pronouncing Names Correctly

Quiz
•
University
15 questions
Parts of Speech

Quiz
•
1st Grade - University
1 questions
Savings Questionnaire

Quiz
•
6th Grade - Professio...
26 questions
Parent Functions

Quiz
•
9th Grade - University
18 questions
Parent Functions

Quiz
•
9th Grade - University