
DAA Quiz 1/GLBITM

Quiz
•
English
•
University
•
Medium
Nitish Ranjan
Used 5+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
What is the time complexity of Quick Sort in the average case?
O(log n)
O(n)
O(n log n)
O(n^2)
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The main key point behind Shell Sort and its advantages over simple insertion sort.
Shell Sort improves efficiency over simple insertion sort by allowing exchanges of distant elements
Shell Sort only works with small datasets.
Insertion sort is faster than Shell Sort for all cases.
Shell Sort does not allow any element exchanges.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Compare the time complexities of Merge Sort and Heap Sort. Which one is generally faster and why?
Heap Sort is generally faster than Merge Sort.
Merge Sort is generally faster than Heap Sort.
Both algorithms have the same time complexity and speed.
Merge Sort is slower due to its recursive nature.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the best-case time complexity of Merge Sort?
O(log n)
O(n^2)
O(n log n)
O(n)
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Describe a scenario where using a linear time sorting algorithm is preferable over comparison-based sorting algorithms.
Using comparison-based sorting algorithms is faster for sorting integers within a limited range.
Linear time sorting algorithms are ideal for sorting large datasets with no known range.
Using a linear time sorting algorithm is preferable when sorting integers within a known, limited range.
Using a linear time sorting algorithm is best for sorting strings alphabetically.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Implement a basic version of Quick Sort in pseudocode.
function quickSort(array) { if (array.length <= 1) { return array; } let pivot = array[array.length - 1]; let left = []; let right = []; for (let i = 0; i < array.length - 1; i++) { if (array[i] < pivot) { left.push(array[i]); } else { right.push(array[i]); } } return quickSort(left).concat(pivot, quickSort(right)); }
function quickSort(array) { return array; }
function quickSort(array) { for (let i = 0; i < array.length; i++) { left.push(array[i]); } }
function quickSort(array) { let pivot = array[0]; }
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the worst-case time complexity of Shell Sort?
O(n log n)
O(n^2)
O(log n)
O(n)
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
DUT let's go 1

Quiz
•
University
15 questions
Understanding Complexity and Sorting

Quiz
•
University
10 questions
3rd Grade Spelling Challenge

Quiz
•
3rd Grade - University
10 questions
The Plastic Problem

Quiz
•
2nd Grade - University
10 questions
Exploring Chapter 8 of Harry Potter

Quiz
•
5th Grade - University
12 questions
Vocabulary Unit 4

Quiz
•
11th Grade - University
15 questions
Alphabet

Quiz
•
1st Grade - University
10 questions
City of Ember ch. 11

Quiz
•
KG - University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade