WGU C949 Data Structures and Algorithms
Objective Assessment Actual Exam 2026/2027 –
Complete Exam-Style Questions with Detailed
Rationales | Pass Guaranteed – A+ Graded
[SECTION 1: Algorithm Analysis & Big O Notation — Questions 1-25]
Q1: What is the time complexity of accessing an element in an array by its index?
A. O(n)
B. O(log n)
C. O(1)
D. O(n log n)
Correct Answer: C
Rationale: Accessing an array element by index is a constant time operation, O(1), because
arrays use random access memory; the calculation of the memory address is a simple arithmetic
operation. O(n) (A) implies iterating through elements. O(log n) (B) implies halving the search
space. O(n log n) (D) is typical for efficient sorting algorithms like merge sort.
Q2: Which of the following time complexities represents the worst-case performance of a linear
search algorithm on an unsorted array of size n?
A. O(1)
B. O(log n)
C. O(n)
D. O(n²)
Correct Answer: C
Rationale: Linear search checks every element in the array one by one in the worst case (where
the element is at the end or not present), resulting in O(n). O(1) (A) is constant time. O(log n) (B)
is for binary search. O(n²) (D) typically involves nested loops like bubble sort.
,2
Q3: In Big O notation, which complexity is considered the most efficient for large datasets?
A. O(n)
B. O(n²)
C. O(log n)
D. O(n!)
Correct Answer: C
Rationale: O(log n) grows much slower than linear O(n) or quadratic O(n²) as the input size
increases, making it highly efficient. O(n!) (D) represents factorial time, which is extremely
inefficient. O(n²) (B) is generally inefficient for large data. O(n) (A) is efficient but not as
efficient as logarithmic.
Q4: What is the space complexity of a recursive function that has a maximum recursion depth of
n and uses a constant amount of memory for local variables in each call?
A. O(1)
B. O(log n)
C. O(n)
D. O(n²)
Correct Answer: C
Rationale: The space complexity is determined by the memory used by the call stack. If the
recursion depth is n, and each frame uses O(1) space, the total space is O(n). O(1) (A) would be
iterative or tail recursion optimized. O(n²) (D) would imply storing more data per frame.
Q5: Which sorting algorithm has a worst-case time complexity of O(n²)?
A. Merge Sort
C. Quicksort
D. Heap Sort
,3
Correct Answer: C
Rationale: Quicksort has a worst-case time complexity of O(n²), which occurs when the pivot
selection results in highly unbalanced partitions (e.g., already sorted data with a poor pivot
strategy). Merge Sort (A) and Heap Sort (D) consistently perform at O(n log n) in the worst case.
Q6: Consider a loop that iterates n times, and inside that loop, another loop iterates n times. What
is the overall time complexity?
A. O(n)
B. O(log n)
C. O(n²)
D. O(n log n)
Correct Answer: C
Rationale: Nested loops where both depend on n result in quadratic time complexity, O(n²),
because for every iteration of the outer loop, the inner loop runs n times. O(n) (A) is for a single
loop. O(n log n) (D) is typically divide and conquer.
Q7: What is the best-case time complexity for Binary Search on a sorted array?
A. O(1)
C. O(1)
D. O(log n)
Correct Answer: C
Rationale: While Binary Search is generally O(log n), the best case occurs when the target
element is found at the very first midpoint, which is a constant time operation, O(1). O(log n) (D)
is the average and worst case. O(n) (B) is for linear search.
Q8: Which of the following describes an algorithm with time complexity O(2^n)?
, 4
A. Efficient for large inputs.
B. Grows linearly.
C. Grows exponentially.
D. Grows logarithmically.
Correct Answer: C
Rationale: O(2^n) represents exponential growth, where the time doubles with every addition to
the input size. This is considered very inefficient and intractable for anything but very small
inputs. Linear (B) is O(n). Logarithmic (D) is O(log n).
Q9: In the context of space complexity, what does "auxiliary space" refer to?
A. The space taken by the input data.
C. The extra space or temporary space used by an algorithm.
D. The space occupied by the output.
Correct Answer: C
Rationale: Auxiliary space refers to the extra memory space used by the algorithm apart from the
space taken by the input data. Input space (A) is not usually counted towards auxiliary space.
Output space (D) is also typically excluded from the auxiliary metric.
Q10: Which complexity class is typically associated with algorithms that use a "divide and
conquer" strategy, like Merge Sort?
A. O(n²)
C. O(n log n)
D. O(2^n)
Correct Answer: C
Rationale: Divide and conquer algorithms typically split the problem into smaller subproblems
(divide), solve them recursively (conquer), and combine the results. This usually leads to a