WGU C949 Data Structures and Algorithms Actual preparation test exam with Thorough and Correct Answers Updated 2024/2025
1 view 0 purchase
Module
WGU C949 Data Structure and Algorithm
Institution
WGU C949 Data Structure And Algorithm
WGU C949 Data Structures and Algorithms Actual preparation test exam with Thorough and Correct Answers Updated 2024/2025
Conditional List - correct answer new list = [expression for name in iterable if condition]
Algorithm Efficiency - correct answer measures algorithm complexity
Computati...
Computational Complexity - correct answer amount of
resources used by algorithm. ex-runtime / memory usage.
Runtime Complexity - correct answer T(N) represents
number of constant time operations performed by algorithm
where N is input size. Has a lower bound and upper bound
Space Complexity - correct answer S(N) represents number
of fixed-size memory units used by an algorithm for an input size
N.
Ex. S(N) = N + k where k is constant representing memory used
for things like loop counters
Auxiliary Space Complexity - correct answer Space
complexity not included in data.
Lower bound - correct answer f(N) that is <= the best case of
T(N), for all values N>=1
,Upper bound - correct answer f(N) that is >= worst case of
T(N), for all values N>=1
omega (Ω notation) - correct answer notation that provides a
growth rate for an algorithm's lower bound.
theta (Θ notation) - correct answer notation that provides a
growth rate that is both an upper and lower bound
Big O - correct answer notation for expressing the worst-case
run-time of an algorithm, useful for comparing the speed of two
algorithms.
Selection Sort - correct answer A sort algorithm that
repeatedly scans for the smallest item in the list and swaps it
with the element at the current index. The index is then
incremented, and the process repeats until the last two elements
are sorted.
Run time : O(N^2)
Insertion Sort - correct answer A simple sorting algorithm
that builds the final sorted array (or list) one item at time. It is
much less efficient on large lists than more advanced algorithms
such as quicksort, heapsort, or merge sort.
Run time : O(N^2)
,selection, insertion - correct answer difference is in what the
inner loop does:
In _______ sort, the inner loop is over the unsorted elements.
Each pass selects one element, and moves it to its final location
(at the current end of the sorted region).
In _______ sort, each pass of the inner loop iterates over the
sorted elements.
Shell Sort - correct answer Starts by sorting pairs of
elements far apart from each other, then progressively reducing
the gap between elements to be compared. Starting with far
apart elements can move some out-of-place elements into
position faster than a simple nearest neighbor exchange.
gap value: distance between elements in an interleaved list
Worst Case: O(N^(3/2))
Quick Sort - correct answer Unstable, O(n log n) for a good
pivot,O(n^2) for a bad pivot Ω(n log n) : Uses partitioning O(n),
Pick a median of 1st, middle, and last element for pivot. Random
selection is also good, but expensive. Algorithm can be slow
because of many function calls.
Midpoint: i + (k-i)/2
def quicksort (numbers, start_index, end_index):
, Merge Sort - correct answer Sorting algorithm that divides a
list into two halves, recursively sorts each half, and then merges
the sorted halves to produce a sorted list.
Runtime : O(N log N)
i=left index i - j
k = right index j+1 - k
j = middle index
Bucket Sort - correct answer a category of sorting algorithms
that places numbers into buckets based on some common
attribute, then combines bucket contents to produce a sorted
array
Radix Sort - correct answer an O(n*k) search algorithm
where K = keylength. Stable. Sorts input into bins based on the
lowest digit; then combines bins in order and sorts on the next
highest digit & so forth.
O(d(n+b))
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller KieranKent55. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for £10.20. You're not tied to anything after your purchase.