
Divide and Conquer
Authored by Prithi S
Computers
University
Used 22+ times

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

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
15 questions
COMP_FUND_PROG-QUIZ #2
Quiz
•
University
15 questions
CIS1101-programming practice
Quiz
•
University
10 questions
Teste python- Unesp-Jaboticabal
Quiz
•
University
10 questions
MÓDULO II: GESTIÓN Y USO DE LAS TABLETAS
Quiz
•
University
10 questions
pointers and structures
Quiz
•
University
10 questions
Third Year Placement Training Revision Test
Quiz
•
University
10 questions
SRD QUIZ 3 CHAPTER 4
Quiz
•
University
10 questions
Weekly Quiz 1
Quiz
•
4th Grade - Professio...
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade