• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 3 out of 17 pages
Exam (elaborations)

WGU C950 Data Structures and Algorithms II: Exam 3 Questions with Correct Answers

Document preview thumbnail
Preview 3 out of 17 pages

WGU C950 Data Structures and Algorithms II: Exam 3 Questions with Correct Answers 100 questions 1. A function that calls itself twice per call with input n-1 (like naive Fibonacci) has complexity about: A. O(n) B. O(2^n) C. O(log n) D. O(n^2) Correct Answer: B. O(2^n) Rationale: Exponential recursion tree. 2. The lower bound for comparison-based sorting in the worst case is: A. Omega(n) B. Omega(n log n) C. Omega(1) D. Omega(n^2) Correct Answer: B. Omega(n log n) Rationale: Decision-tree argument. 3. Space complexity of storing an n x n distance matrix is:

Content preview

WGU C950 Data Structures and Algorithms II: Exam 3 -
Questions with Correct Answers
100 questions

1. A function that calls itself twice per call with input n-1 (like naive Fibonacci) has complexity
about:
A. O(n)
B. O(2^n)
C. O(log n)
D. O(n^2)
Correct Answer: B. O(2^n)
Rationale: Exponential recursion tree.

2. The lower bound for comparison-based sorting in the worst case is:
A. Omega(n)
B. Omega(n log n)
C. Omega(1)
D. Omega(n^2)
Correct Answer: B. Omega(n log n)
Rationale: Decision-tree argument.

3. Space complexity of storing an n x n distance matrix is:
A. O(n)
B. O(1)
C. O(n^2)
D. O(log n)
Correct Answer: C. O(n^2)
Rationale: n squared cells.

4. Checking whether an item exists in a Python list using 'in' has complexity:
A. O(n)
B. O(1)
C. O(log n)
D. O(n log n)
Correct Answer: A. O(n)
Rationale: Linear scan.

5. An in-place algorithm uses:
A. O(n^2) memory
B. Unlimited memory
C. Only disk storage
D. O(1) or very little extra memory
Correct Answer: D. O(1) or very little extra memory
Rationale: Modifies input directly.

6. Big-Omega notation describes:
A. An upper bound
B. The average only
C. A lower bound on growth rate
D. Memory size
Correct Answer: C. A lower bound on growth rate
Rationale: Best-case style bound.

,7. Removing the first element of a Python list with pop(0) is:
A. O(1)
B. O(log n)
C. O(n)
D. O(n^2)
Correct Answer: C. O(n)
Rationale: Shifts elements; use deque instead.

8. Best-case complexity of linear search is:
A. O(n)
B. O(log n)
C. O(n^2)
D. O(1)
Correct Answer: D. O(1)
Rationale: Item at first position.

9. Using an Enum or constants for package status values ('At hub', 'En route', 'Delivered')
improves:
A. Speed only
B. Memory only
C. Nothing
D. Readability and reduces typos
Correct Answer: D. Readability and reduces typos
Rationale: Maintainability.

10. Which data structure is best for a FIFO queue in Python?
A. collections.deque
B. list with pop(0)
C. dict
D. set
Correct Answer: A. collections.deque
Rationale: O(1) popleft.

11. The datetime and timedelta classes are useful for:
A. Hashing
B. Sorting strings
C. Tracking times such as truck departure and delivery times
D. Drawing graphs
Correct Answer: C. Tracking times such as truck departure and delivery times
Rationale: Time arithmetic.

12. Integer division in Python 3 uses the operator:
A. /
B. //
C. %
D. **
Correct Answer: B. //
Rationale: Floor division.

, 13. To look up the distance between address index i and j in a lower-triangular matrix, you
should:
A. Check both [i][j] and [j][i] because only one may be filled
B. Use only [i][j] always
C. Add i and j
D. Sort the matrix first
Correct Answer: A. Check both [i][j] and [j][i] because only one may be filled
Rationale: Symmetric distances.

14. The time complexity of list.remove(value) is:
A. O(1)
B. O(log n)
C. O(n)
D. O(n^2)
Correct Answer: C. O(n)
Rationale: Search and shift.

15. The __init__ method in a Python class is:
A. The constructor that initializes a new object
B. A destructor
C. A static variable
D. A loop
Correct Answer: A. The constructor that initializes a new object
Rationale: Initializer.

16. A Python module is:
A. A class only
B. A file containing Python definitions and statements
C. A variable
D. A loop
Correct Answer: B. A file containing Python definitions and statements
Rationale: Organizes code.

17. Quadratic probing checks slots at offsets of:
A. 1, 2, 3, 4
B. Random
C. 1, 4, 9, 16, ... from the original index
D. Doubling powers of 10
Correct Answer: C. 1, 4, 9, 16, ... from the original index
Rationale: Reduces primary clustering.

18. Using only the string length as a hash for addresses would cause:
A. No collisions
B. Perfect distribution
C. Faster lookups always
D. Many collisions
Correct Answer: D. Many collisions
Rationale: Poor distribution.

Document information

Uploaded on
October 14, 2026
Number of pages
17
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$13.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
0
Followers
0
Items
332
Last sold
-




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