WGU DSA1 C949 V3 EXAM COMPLETE QUESTIONS AND
100% VERIFIED ANSWERS (PASS GUARANTEE)
1. What is Big O notation? Big O notation describes the upper bound of an
algorithm's time or space complexity, representing worst-case performance as
input size grows.
2. What is the Big O complexity of accessing an array element by index?
O(1) - constant time, as array elements can be accessed directly using their
index.
3. What is the Big O of linear search? O(n) - in the worst case, you must
check every element in the collection.
4. What is the Big O of binary search? O(log n) - the search space is halved
with each iteration.
5. What does O(n²) complexity indicate? Quadratic time complexity, typically
indicating nested loops where each element is compared with every other
element.
6. What is the Big O of bubble sort? O(n²) in the worst and average cases,
O(n) in the best case when the array is already sorted.
7. What is the Big O of merge sort? O(n log n) for all cases (best, average, and
worst).
8. What is the Big O of quicksort? O(n log n) average case, O(n²) worst case
(when pivot selection is poor).
9. What is space complexity? Space complexity measures the amount of
memory an algorithm uses relative to the input size.
10. What is the space complexity of merge sort? O(n) - requires additional
space for the temporary arrays during merging.
11. What is the space complexity of quicksort? O(log n) average case due to
recursive call stack, O(n) worst case.
12. What does O(1) space complexity mean? Constant space - the algorithm
uses a fixed amount of memory regardless of input size.
,13. What is the Big O of insertion sort? O(n²) worst and average cases, O(n)
best case.
14. What is the difference between Big O, Big Ω, and Big Θ? Big O is upper
bound (worst case), Big Ω is lower bound (best case), Big Θ is tight bound
(average case).
15. What is the Big O of selection sort? O(n²) for all cases.
16. Why is O(log n) better than O(n)? Logarithmic complexity grows much
slower than linear complexity as input size increases.
17. What operation has O(n) complexity in a linked list? Searching for an
element or accessing by index (must traverse from head).
18. What is the Big O of adding to the end of a dynamic array (amortized)?
O(1) amortized - occasionally requires O(n) for resizing, but averages to
constant time.
19. What is the Big O of heap sort? O(n log n) for all cases.
20. What does it mean when an algorithm is "in-place"? It uses O(1) or very
little extra space beyond the input itself.
21. What is the Big O of finding the maximum element in an unsorted
array? O(n) - must check every element.
22. What is the Big O of multiplying two n×n matrices? O(n³) using the
standard algorithm.
23. What is amortized analysis? Analyzing the average performance over a
sequence of operations rather than worst-case for a single operation.
24. What is the Big O of bucket sort in the average case? O(n + k) where k is
the number of buckets.
25. What is the Big O of radix sort? O(d × (n + k)) where d is the number of
digits and k is the range of digit values.
26. What is the Big O of counting sort? O(n + k) where k is the range of input
values.
27. What is the time complexity of building a heap? O(n) using the bottom-
up approach.
28. What is the Big O of traversing a binary tree? O(n) - must visit each
node once.
, 29. What is the best case Big O for quicksort? O(n log n) when the pivot
consistently divides the array evenly.
30. What is the Big O of checking if a hash table contains a key? O(1)
average case, O(n) worst case with many collisions.
31. What is the space complexity of insertion sort? O(1) - it's an in-place
algorithm.
32. What is the Big O of deleting from the middle of an array? O(n) -
elements after the deletion point must be shifted.
33. What is the Big O of DFS (Depth-First Search) on a graph? O(V + E)
where V is vertices and E is edges.
34. What is the Big O of BFS (Breadth-First Search) on a graph? O(V + E)
where V is vertices and E is edges.
35. What makes an algorithm O(2^n)? Exponential complexity, often from
recursive algorithms that branch into two recursive calls per level.
36. What is the Big O of finding all subsets of a set? O(2^n) - there are 2^n
possible subsets.
37. What is the Big O of the Fibonacci sequence using naive recursion?
O(2^n) - exponential due to redundant calculations.
38. What is the Big O of Fibonacci using dynamic programming? O(n) with
O(n) space, or O(n) with O(1) space using iteration.
39. What is the Big O of inserting at the head of a linked list? O(1) - just
update pointers.
40. What is the Big O of concatenating two strings of length n and m? O(n +
m) - must copy all characters from both strings.
41. What is dropping constants in Big O? Ignoring constant factors; O(2n)
becomes O(n), O(n/2) becomes O(n).
42. What is dropping non-dominant terms? Keeping only the fastest-growing
term; O(n² + n) becomes O(n²).
43. What is the Big O of nested loops iterating n times each? O(n²) for two
nested loops, O(n³) for three, etc.
44. What is the Big O of binary tree insertion (average case)? O(log n) for a
balanced tree, O(n) for a degenerate tree.
100% VERIFIED ANSWERS (PASS GUARANTEE)
1. What is Big O notation? Big O notation describes the upper bound of an
algorithm's time or space complexity, representing worst-case performance as
input size grows.
2. What is the Big O complexity of accessing an array element by index?
O(1) - constant time, as array elements can be accessed directly using their
index.
3. What is the Big O of linear search? O(n) - in the worst case, you must
check every element in the collection.
4. What is the Big O of binary search? O(log n) - the search space is halved
with each iteration.
5. What does O(n²) complexity indicate? Quadratic time complexity, typically
indicating nested loops where each element is compared with every other
element.
6. What is the Big O of bubble sort? O(n²) in the worst and average cases,
O(n) in the best case when the array is already sorted.
7. What is the Big O of merge sort? O(n log n) for all cases (best, average, and
worst).
8. What is the Big O of quicksort? O(n log n) average case, O(n²) worst case
(when pivot selection is poor).
9. What is space complexity? Space complexity measures the amount of
memory an algorithm uses relative to the input size.
10. What is the space complexity of merge sort? O(n) - requires additional
space for the temporary arrays during merging.
11. What is the space complexity of quicksort? O(log n) average case due to
recursive call stack, O(n) worst case.
12. What does O(1) space complexity mean? Constant space - the algorithm
uses a fixed amount of memory regardless of input size.
,13. What is the Big O of insertion sort? O(n²) worst and average cases, O(n)
best case.
14. What is the difference between Big O, Big Ω, and Big Θ? Big O is upper
bound (worst case), Big Ω is lower bound (best case), Big Θ is tight bound
(average case).
15. What is the Big O of selection sort? O(n²) for all cases.
16. Why is O(log n) better than O(n)? Logarithmic complexity grows much
slower than linear complexity as input size increases.
17. What operation has O(n) complexity in a linked list? Searching for an
element or accessing by index (must traverse from head).
18. What is the Big O of adding to the end of a dynamic array (amortized)?
O(1) amortized - occasionally requires O(n) for resizing, but averages to
constant time.
19. What is the Big O of heap sort? O(n log n) for all cases.
20. What does it mean when an algorithm is "in-place"? It uses O(1) or very
little extra space beyond the input itself.
21. What is the Big O of finding the maximum element in an unsorted
array? O(n) - must check every element.
22. What is the Big O of multiplying two n×n matrices? O(n³) using the
standard algorithm.
23. What is amortized analysis? Analyzing the average performance over a
sequence of operations rather than worst-case for a single operation.
24. What is the Big O of bucket sort in the average case? O(n + k) where k is
the number of buckets.
25. What is the Big O of radix sort? O(d × (n + k)) where d is the number of
digits and k is the range of digit values.
26. What is the Big O of counting sort? O(n + k) where k is the range of input
values.
27. What is the time complexity of building a heap? O(n) using the bottom-
up approach.
28. What is the Big O of traversing a binary tree? O(n) - must visit each
node once.
, 29. What is the best case Big O for quicksort? O(n log n) when the pivot
consistently divides the array evenly.
30. What is the Big O of checking if a hash table contains a key? O(1)
average case, O(n) worst case with many collisions.
31. What is the space complexity of insertion sort? O(1) - it's an in-place
algorithm.
32. What is the Big O of deleting from the middle of an array? O(n) -
elements after the deletion point must be shifted.
33. What is the Big O of DFS (Depth-First Search) on a graph? O(V + E)
where V is vertices and E is edges.
34. What is the Big O of BFS (Breadth-First Search) on a graph? O(V + E)
where V is vertices and E is edges.
35. What makes an algorithm O(2^n)? Exponential complexity, often from
recursive algorithms that branch into two recursive calls per level.
36. What is the Big O of finding all subsets of a set? O(2^n) - there are 2^n
possible subsets.
37. What is the Big O of the Fibonacci sequence using naive recursion?
O(2^n) - exponential due to redundant calculations.
38. What is the Big O of Fibonacci using dynamic programming? O(n) with
O(n) space, or O(n) with O(1) space using iteration.
39. What is the Big O of inserting at the head of a linked list? O(1) - just
update pointers.
40. What is the Big O of concatenating two strings of length n and m? O(n +
m) - must copy all characters from both strings.
41. What is dropping constants in Big O? Ignoring constant factors; O(2n)
becomes O(n), O(n/2) becomes O(n).
42. What is dropping non-dominant terms? Keeping only the fastest-growing
term; O(n² + n) becomes O(n²).
43. What is the Big O of nested loops iterating n times each? O(n²) for two
nested loops, O(n³) for three, etc.
44. What is the Big O of binary tree insertion (average case)? O(log n) for a
balanced tree, O(n) for a degenerate tree.