DISCRETE MATHEMATICS II OBJECTIVE ASSESSMENT /
ACTUAL WGU C960 (OA) QUESTION BANK AND STUDY GUIDE
COMPLETE ACCURATE EXAM REAL QUESTIONS AND
CORRECT DETAILED ANSWERS WITH RATIONALES (100%
CORRECT VERIFIED SOLUTIONS) CURRENTLY UPDATED
VERSION 2026 EDITION |GUARANTEED PASS A+ |JUST
RELEASED
1. What is the time complexity of the following algorithm?
text
for i = 1 to n:
for j = i to n:
print(i, j)
A) O(n)
B) O(n log n)
C) O(n²)
D) O(n³)
Correct Answer: C) O(n²)
Rationale: The outer loop runs n times. The inner loop runs from i to n,
so the total number of iterations is n + (n-1) + (n-2) + ... + 1 = n(n+1)/2,
which is O(n²) . This is a classic nested loop analysis problem frequently
tested.
,2. Which of the following represents the best-case time complexity of
insertion sort?
A) O(n)
B) O(n log n)
C) O(n²)
D) O(log n)
Correct Answer: A) O(n)
Rationale: Insertion sort has a best-case time complexity of O(n) when
the input array is already sorted. In this scenario, only one comparison
per element is needed, making it linear. This is a fundamental concept in
algorithm analysis.
3. Given f(n) = 3n² + 5n + 2, which of the following is true?
A) f(n) = O(n)
B) f(n) = O(n²)
C) f(n) = O(n³)
D) Both B and C
Correct Answer: D) Both B and C
Rationale: Big O notation describes an upper bound. f(n) = 3n² + 5n + 2
is O(n²) because n² is the dominant term. It is also O(n³) because n² ≤ n³
,for all n ≥ 1. The tightest bound is O(n²), but both statements are
mathematically correct.
4. What is the time complexity of binary search on a sorted array of size
n?
A) O(n)
B) O(log n)
C) O(n log n)
D) O(1)
Correct Answer: B) O(log n)
Rationale: Binary search works by repeatedly dividing the search
interval in half. After k steps, the search space is n/2^k. The algorithm
terminates when n/2^k ≤ 1, so k ≤ log₂ n. Thus, the time complexity is
O(log n).
5. Which sorting algorithm has the worst-case time complexity of O(n
log n)?
A) Bubble Sort
B) Insertion Sort
C) Merge Sort
D) Selection Sort
Correct Answer: C) Merge Sort
, Rationale: Merge sort consistently achieves O(n log n) time complexity
in all cases (best, average, and worst). Bubble sort, insertion sort, and
selection sort all have worst-case O(n²) complexity.
6. The recurrence relation T(n) = 2T(n/2) + O(n) describes which
algorithm?
A) Binary Search
B) Merge Sort
C) Quick Sort
D) Linear Search
Correct Answer: B) Merge Sort
Rationale: The recurrence T(n) = 2T(n/2) + O(n) represents the divide-
and-conquer approach where a problem of size n is divided into 2
subproblems of size n/2, with O(n) work to combine the results. This is
the exact recurrence for merge sort.
7. What is the time complexity of the following algorithm?
text
i=1
while i < n:
i=i*2