WGU C960 PA– Discrete Mathematics II
(New 2026/ 2027 Update) Questions &
Answers {Grade A} 100% Correct (Verified
Solutions)
Pre-Assessment: Algorithms - Analyzing Algorithms:
Question 4:
Function Sampler (Sequence Data)
Set Sample to an empty sequence
Set N to the length of Data
While N>=1
Append element N of Data to Sample
N:= N/2
Return Sample
What is the worst-case run time for Function Sampler? - correct answer O(log₂N)
Pre-Assessment: Algorithms - Analyzing Algorithms:
Question 5:
,Given this algorithm:
Simple Sort
This algorithm sorts the elements of an array.
Input: numb, an array of n integers
Output: numb, in ascending order
for i = 1 to n
for j = 1 to n - i
if numb(j) > numb(j + 1)
temp = numb(j)
numb(j) = numb(j + 1)
numb(j + 1) = temp
end for
end for
What is the asymptotic worst-case complexity? - correct answer O(n²)
Pre-Assessment: Algorithms - Big-O Estimates:
,Question 7:
Assume that the Sort(list L) function operates in O(nlogn) time, where n is the length
of the list (of numbers.)
Variables L1, L2, and L3 are lists of real numbers, all of length n.
Given the following pseudocode function:
Function Sort3(L1, L2, L3)
K1 = Sort(L1)
For each element, E1, of L1,
Add E1 to each element of L2
K2 = Sort(L2)
For each element, E2, of L2
Add E2 to each element of L3
K3 = Sort(L3)
End-For
End-For
L = Append lists K3, K1, and K2
return L
, Which function dominates the run time of Sort3(L1, L2, L3)? - correct answer O(n³logn)
Pre-Assessment: Algorithms - Big-O Estimates:
Question 8:
Which function is Θ(x³)? - correct answer 4x³ + √x−1
Pre-Assessment: Algorithms - Big-O Estimates:
Question 9:
What is the big-O notation for the function
f(n) = n × log(n²) + 7n³ + 5n + 3? - correct answer O(n³)
Pre-Assessment: Counting and Advanced Counting Techniques - Advance Counting
Techniques
Question 39:
(New 2026/ 2027 Update) Questions &
Answers {Grade A} 100% Correct (Verified
Solutions)
Pre-Assessment: Algorithms - Analyzing Algorithms:
Question 4:
Function Sampler (Sequence Data)
Set Sample to an empty sequence
Set N to the length of Data
While N>=1
Append element N of Data to Sample
N:= N/2
Return Sample
What is the worst-case run time for Function Sampler? - correct answer O(log₂N)
Pre-Assessment: Algorithms - Analyzing Algorithms:
Question 5:
,Given this algorithm:
Simple Sort
This algorithm sorts the elements of an array.
Input: numb, an array of n integers
Output: numb, in ascending order
for i = 1 to n
for j = 1 to n - i
if numb(j) > numb(j + 1)
temp = numb(j)
numb(j) = numb(j + 1)
numb(j + 1) = temp
end for
end for
What is the asymptotic worst-case complexity? - correct answer O(n²)
Pre-Assessment: Algorithms - Big-O Estimates:
,Question 7:
Assume that the Sort(list L) function operates in O(nlogn) time, where n is the length
of the list (of numbers.)
Variables L1, L2, and L3 are lists of real numbers, all of length n.
Given the following pseudocode function:
Function Sort3(L1, L2, L3)
K1 = Sort(L1)
For each element, E1, of L1,
Add E1 to each element of L2
K2 = Sort(L2)
For each element, E2, of L2
Add E2 to each element of L3
K3 = Sort(L3)
End-For
End-For
L = Append lists K3, K1, and K2
return L
, Which function dominates the run time of Sort3(L1, L2, L3)? - correct answer O(n³logn)
Pre-Assessment: Algorithms - Big-O Estimates:
Question 8:
Which function is Θ(x³)? - correct answer 4x³ + √x−1
Pre-Assessment: Algorithms - Big-O Estimates:
Question 9:
What is the big-O notation for the function
f(n) = n × log(n²) + 7n³ + 5n + 3? - correct answer O(n³)
Pre-Assessment: Counting and Advanced Counting Techniques - Advance Counting
Techniques
Question 39: