Gunadarma University
Subject : Algorithm Parallel Processing
Faculty : Industrial Technology
Program of Study : Informatics Engineering Major
Years : 2024
Search And Sorting Algorithm Quiz
1. Which of the following sorting algorithms has the best average-case time complexity?
A) Bubble Sort
B) Selection Sort
C) Merge Sort
D) Insertion Sort
Explanation: Merge Sort has an average-case time complexity of O(n logn), which is more
efficient than the average-case time complexities of Bubble Sort (O(n2)), Selection Sort (O(n2)),
and Insertion Sort (O(n2)).
2. What is the worst-case time complexity of Quick Sort?
A) O(n logn)
B) O(n2)
C) O(n)
D) O(logn)
Explanation: Quick Sort has a worst-case time complexity of O(n2), which occurs when the pivot
selection consistently results in unbalanced partitions. However, with good pivot selection
strategies, its average-case time complexity is O(n logn).