Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 4 out of 43 pages
Exam (elaborations)

WGU C960 Discrete Mathematics II: The Ultimate 2026 OA Practice Bank –Questions, Verified Answers, and Step-by-Step Rationales

Document preview thumbnail
Preview 4 out of 43 pages

WGU C960 Discrete Mathematics II: The Ultimate 2026 OA Practice Bank –Questions, Verified Answers, and Step-by-Step Rationales

Content preview

WGU C960 Discrete Mathematics II:
The Ultimate 2026 OA Practice Bank –
Questions, Verified Answers, and
Step-by-Step Rationales


Algorithms & Pseudocode

Question
Consider the following pseudocode:

text
x := 2
If (x > 0)
abs := x
Else
abs := -x
End-if


What is the final value of abs?

Answer: C. 2

Rationale: The condition (x > 0) evaluates to true because x = 2. The line abs := x is
executed, assigning the value 2 to abs. The Else branch is skipped entirely.

,Question
What is the final value of product after the following pseudocode is run?

text
x := -2
product := 1
count := 5
While (count > 0)
product := product * count
count := count - 2
End-while


Answer: C. 15

Rationale: First iteration: count = 5, product = 1 × 5 = 5, count becomes 3. Second
iteration: count = 3, product = 5 × 3 = 15, count becomes 1. The loop executes a third
iteration: count = 1, product = 15 × 1 = 15, count becomes -1. The loop stops
because count > 0 is false.




Question
How many iterations will the loop in the previous question execute?

Answer: C. 3

Rationale: The count values during the loop are 5, 3, and 1. Each time count > 0, the
loop executes. When count becomes -1, the condition is false. Therefore, the loop
executes exactly 3 iterations.

,Question
Function Sampler(Sequence Data) sets N to the length of Data and processes while N ≥ 1.
If Data = [1, 3, 5, 7, 9], how many times does the loop iterate?

Answer: C. 5

Rationale: The loop continues as long as N ≥ 1. Starting with N = 5, it will iterate for N =
5, 4, 3, 2, 1 — a total of 5 iterations — before N becomes 0 and the condition fails.




Question
What is the worst-case time complexity of the Merge0 function that merges two sorted
lists of length n?

Answer: B. O(n)

Rationale: The Merge0 function processes each element from both lists exactly once.
Each removal and addition operation is O(1). With two lists of total length 2n, the
algorithm performs exactly 2n operations, giving linear time complexity O(n).




Question
Assume Sort(list L) operates in O(n log n) time for n = length of list. Given Sort3(L1,
L2, L3) where each list has length n, which function dominates the run time?

Answer: C. O(n³ log n)

Rationale: The algorithm includes Sort operations (O(n log n) each) nested within loops
that iterate through lists. Analysis shows the nested structure yields O(n³ log n) as the
dominant time complexity.

, Question
Which function is Θ(x³)?

Answer: B. 4x³ + √x − 1

Rationale: A function is Θ(x³) if its highest-degree term is exactly x³ (constant
coefficients do not affect asymptotic growth). Option B has the leading term 4x³, making
it Θ(x³). All other options have different leading terms (x², x⁴, or x).




Question
The primary resources to optimize when analyzing an algorithm are:

Answer: time complexity (the time the algorithm requires to run) and space complexity
(the amount of memory used).

Rationale: Algorithm analysis focuses on two main resources: time (how long the
algorithm takes to execute) and space (how much memory it uses). These are the
fundamental measures of algorithm efficiency.




Question
The time an algorithm takes to run depends on:

Answer: the speed of the processing unit, the number of calculations that need to be
performed, and the number of conditions that need to be evaluated.

Document information

Uploaded on
August 4, 2026
Number of pages
43
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$21.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Sold
2
Followers
0
Items
710
Last sold
1 month ago


Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions