DAA Quiz 1/GLBITM

DAA Quiz 1/GLBITM

University

10 Qs

quiz-placeholder

Similar activities

Reading Test on 3R

Reading Test on 3R

University

10 Qs

Computer Science Quiz

Computer Science Quiz

University

10 Qs

AE2 Unit A Vocab 7

AE2 Unit A Vocab 7

10th Grade - University

12 Qs

Suffix Y Ly

Suffix Y Ly

3rd Grade - University

15 Qs

Parts of Speech

Parts of Speech

6th Grade - University

15 Qs

Collocations

Collocations

10th Grade - University

10 Qs

B2-UNIT 3

B2-UNIT 3

University

10 Qs

DAA Quiz 1/GLBITM

DAA Quiz 1/GLBITM

Assessment

Quiz

English

University

Medium

Created by

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

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?