WGU C960 – Discrete Mathematics II Objective Assessment Review | Full Questions, Correct Answers,
and Worked Solutions – 2026 Update | 100% Correct.
1. Merge pseudocode
Question:
Consider the following pseudocode that merges two lists of numbers into one:
Merge0(List1, List2)
Set OUTlist to empty
While List1 is not empty OR List2 is not empty
If one list is empty and the other is not,
Remove the first number from the non-empty list and add it to OUTlist
If both lists are non-empty,
Remove the first number from List1 and add it to OUTlist
Remove the first number from List2 and add it to OUTlist
Return OUTlist
If ListA is [1, 3, 5] and ListB is [2, 4, 6] then what is the result of
Merge0(ListA, Merge0(ListB, ListA))?
Correct answer:
[1, 2, 3, 1, 5, 4, 3, 6, 5]
Solution:
First compute Merge0(ListB, ListA):
Merge [2,4,6] with [1,3,5]
Output becomes [2,1,4,3,6,5]
Now compute Merge0(ListA, [2,1,4,3,6,5]):
Take 1, then 2
Take 3, then 1
Take 5, then 4
ListA is empty, so append remaining 3,6,5
Final result:
[1, 2, 3, 1, 5, 4, 3, 6, 5]
2. Sieve-style pseudocode
Question:
Given this pseudocode, what is S at the end?
,Correct answer:
{2, 3, 5, 7, 11, 13, 17, 19}
Solution:
The code removes multiples of each x from 2 through 10, except x itself. That leaves only primes
in the original set 2 through 20.
3. While loop value
Question:
Given:
x := 2
count := 4
while (count > 0)
x := 2 × x
count := count - 1
What is the final value of x?
Correct answer:
32
Solution:
Start with x = 2. Double it 4 times:
4
8
16
32
4. Runtime of Sampler
Question:
A function repeatedly appends element N of the data and then sets N := N/2. What is the worst-
case runtime?
Correct answer:
O(log₂ N)
Solution:
Each iteration cuts N in half, so the number of iterations is logarithmic.
,5. Simple Sort complexity
Question:
What is the asymptotic worst-case complexity of the given Simple Sort algorithm?
Correct answer:
O(n²)
Solution:
It has nested loops of size about n and n, so total work is quadratic.
6. bubbleSort worst case
Question:
What is the worst-case performance of the given bubble sort pseudocode?
Correct answer:
O(n²)
Solution:
Bubble sort in the worst case performs about n² comparisons/swaps.
7. Dominating runtime of Sort3
Question:
Assume Sort(list L) runs in O(n log n). Which function dominates the runtime of
Sort3(L1, L2, L3)?
Correct answer:
O(n³ log n)
Solution:
There is:
an outer loop over L1 → n
an inner loop over L2 → n
repeated sorting of L3 → O(n log n)
, So dominant term is n × n × (n log n)? Careful: the Sort(L3) occurs inside the loop over
L2, and that whole structure is inside loop over L1, so:
n × n × (n log n) is too much unless each sort is on size n; it is, so result is O(n³ log n).
8. Theta function identification
Question:
Which function is Θ(x³)?
Correct answer:
4x³ + √x − 1
Solution:
The cubic term dominates all lower-order terms, so this is Θ(x³).
9. Big-O notation
Question:
What is the big-O notation for
f(n) = n × log(n²) + 7n³ + 5n + 3?
Correct answer:
O(n³)
Solution:
The highest-growth term is 7n³, which dominates n log(n²) and linear terms.
10. Ones digit of 3^902
Question:
What is the ones digit of 3^902?
Correct answer:
9
Solution:
Powers of 3 cycle in ones digit every 4:
3¹ → 3
3² → 9
and Worked Solutions – 2026 Update | 100% Correct.
1. Merge pseudocode
Question:
Consider the following pseudocode that merges two lists of numbers into one:
Merge0(List1, List2)
Set OUTlist to empty
While List1 is not empty OR List2 is not empty
If one list is empty and the other is not,
Remove the first number from the non-empty list and add it to OUTlist
If both lists are non-empty,
Remove the first number from List1 and add it to OUTlist
Remove the first number from List2 and add it to OUTlist
Return OUTlist
If ListA is [1, 3, 5] and ListB is [2, 4, 6] then what is the result of
Merge0(ListA, Merge0(ListB, ListA))?
Correct answer:
[1, 2, 3, 1, 5, 4, 3, 6, 5]
Solution:
First compute Merge0(ListB, ListA):
Merge [2,4,6] with [1,3,5]
Output becomes [2,1,4,3,6,5]
Now compute Merge0(ListA, [2,1,4,3,6,5]):
Take 1, then 2
Take 3, then 1
Take 5, then 4
ListA is empty, so append remaining 3,6,5
Final result:
[1, 2, 3, 1, 5, 4, 3, 6, 5]
2. Sieve-style pseudocode
Question:
Given this pseudocode, what is S at the end?
,Correct answer:
{2, 3, 5, 7, 11, 13, 17, 19}
Solution:
The code removes multiples of each x from 2 through 10, except x itself. That leaves only primes
in the original set 2 through 20.
3. While loop value
Question:
Given:
x := 2
count := 4
while (count > 0)
x := 2 × x
count := count - 1
What is the final value of x?
Correct answer:
32
Solution:
Start with x = 2. Double it 4 times:
4
8
16
32
4. Runtime of Sampler
Question:
A function repeatedly appends element N of the data and then sets N := N/2. What is the worst-
case runtime?
Correct answer:
O(log₂ N)
Solution:
Each iteration cuts N in half, so the number of iterations is logarithmic.
,5. Simple Sort complexity
Question:
What is the asymptotic worst-case complexity of the given Simple Sort algorithm?
Correct answer:
O(n²)
Solution:
It has nested loops of size about n and n, so total work is quadratic.
6. bubbleSort worst case
Question:
What is the worst-case performance of the given bubble sort pseudocode?
Correct answer:
O(n²)
Solution:
Bubble sort in the worst case performs about n² comparisons/swaps.
7. Dominating runtime of Sort3
Question:
Assume Sort(list L) runs in O(n log n). Which function dominates the runtime of
Sort3(L1, L2, L3)?
Correct answer:
O(n³ log n)
Solution:
There is:
an outer loop over L1 → n
an inner loop over L2 → n
repeated sorting of L3 → O(n log n)
, So dominant term is n × n × (n log n)? Careful: the Sort(L3) occurs inside the loop over
L2, and that whole structure is inside loop over L1, so:
n × n × (n log n) is too much unless each sort is on size n; it is, so result is O(n³ log n).
8. Theta function identification
Question:
Which function is Θ(x³)?
Correct answer:
4x³ + √x − 1
Solution:
The cubic term dominates all lower-order terms, so this is Θ(x³).
9. Big-O notation
Question:
What is the big-O notation for
f(n) = n × log(n²) + 7n³ + 5n + 3?
Correct answer:
O(n³)
Solution:
The highest-growth term is 7n³, which dominates n log(n²) and linear terms.
10. Ones digit of 3^902
Question:
What is the ones digit of 3^902?
Correct answer:
9
Solution:
Powers of 3 cycle in ones digit every 4:
3¹ → 3
3² → 9