WGU C949 Data Structures and Algorithms
I OA Final Exam Actual Exam 2026/2027
with Detailed Rationales | Complete Exam-
Style Questions | Pass Guaranteed – A+
Graded
TABLE OF CONTENTS
Section 1 | Abstract Data Types (ADTs) & Collections | Q1 – Q8
Section 2 | Primitive Data Types & Memory Allocation | Q9 – Q13
Section 3 | Algorithm Analysis, Big-O Notation & Complexity | Q14 –
Q23
Section 4 | Recursion | Q24 – Q31
Section 5 | Basic Data Structures | Q32 – Q41
Section 6 | Sorting & Searching Algorithms | Q42 – Q50
Instructions: Choose the single best answer. Pass: 40/50 in 90 minutes.
══════════════════════════════════════
SECTION 1: ABSTRACT DATA TYPES (ADTs) & COLLECTIONS
Q1 – Q8
══════════════════════════════════════
Question 1 of 50
,2
A hospital emergency room triage system needs to process patients
based on severity of condition rather than arrival time. Patients with life-
threatening conditions must be treated before those with minor injuries,
regardless of when they arrived. Which abstract data type best models
this patient processing system?
A. A standard queue using FIFO ordering where patients are treated in
arrival order
B. A stack using LIFO ordering where the most recent patient is treated
first
C. A priority queue where each patient is assigned a priority value
determining treatment order ✓ CORRECT
D. A bag collection where patients are stored without any specific
ordering
Correct Answer: C
Rationale: A priority queue is an ADT where elements are associated
with priorities and higher-priority elements are dequeued before lower-
priority ones, making it ideal for triage systems that must process critical
cases first regardless of arrival time. A standard queue would process
patients strictly by arrival time (FIFO), which fails to account for
medical urgency, while a stack processes in reverse order of arrival
(LIFO), which also doesn't match the requirement for priority-based
processing.
Question 2 of 50
,3
You are designing a text editor's undo feature. Every action a user
performs (typing text, deleting characters, formatting changes) needs to
be recorded so the user can reverse their most recent action first, then the
one before that, and so on. Which data structure should you use to store
these actions?
A. A queue where actions are enqueued as they occur and dequeued for
undo operations
B. A stack where each action is pushed onto the top and popped during
undo operations ✓ CORRECT
C. A set where actions are stored uniquely and retrieved in arbitrary
order
D. A dictionary mapping action names to timestamps for chronological
retrieval
Correct Answer: B
Rationale: A stack follows LIFO (Last-In-First-Out) semantics, meaning
the most recently pushed action is the first one popped off—exactly
matching the behavior needed for an undo feature where you reverse the
most recent action first. A queue uses FIFO ordering and would undo the
oldest action first, which is not how undo functionality works in
practice.
Question 3 of 50
A print spooler manages documents waiting to be printed on a shared
network printer. Documents submitted earlier should always print before
, 4
documents submitted later, even if a large document arrives after several
small ones. Which ADT correctly implements this first-come-first-
served behavior?
A. A stack that pushes new print jobs and pops them for printing
B. A priority queue that assigns lower priority values to older documents
C. A queue where new jobs are enqueued at the rear and dequeued from
the front ✓ CORRECT
D. A deque that allows insertion and removal from both ends equally
Correct Answer: C
Rationale: A queue implements FIFO (First-In-First-Out) behavior,
where elements enqueued (added) at the rear are dequeued (removed)
from the front in the same order they arrived—perfectly modeling a print
spooler that must respect submission order. While a deque can
implement queue behavior, its primary characteristic is double-ended
access, making queue the more precise and conceptually clear answer
for this strictly FIFO requirement.
Question 4 of 50
A web browser maintains a history of visited pages and allows users to
navigate both forward and backward through this history. Users can go
back to previously visited pages or forward to pages they've already
backed away from. Which ADT provides the necessary operations for
this bidirectional navigation?