Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 3 out of 24 pages
Exam (elaborations)

WGU D446 DATA STRUCTURES AND ALGORITHMS II PRACTICE EXAM QUESTIONS AND ANSWERS

Document preview thumbnail
Preview 3 out of 24 pages

WGU D446 DATA STRUCTURES AND ALGORITHMS II PRACTICE EXAM QUESTIONS AND ANSWERS

Content preview

WGU D446 DATA STRUCTURES AND
ALGORITHMS II PRACTICE EXAM
QUESTIONS AND ANSWERS



1. What is the worst-case time complexity of the Quicksort algorithm?

A. O(n log n)


B. O(n^2)


C. O(log n)


D. O(n)


Answer: B


Conceptual Explanation: Quicksort has a worst-case time complexity of O(n^2) when the

pivot selection consistently results in highly unbalanced partitions, such as when the array

is already sorted and the first or last element is chosen as the pivot.


2. Which of the following data structures is typically used to implement Breadth-First Search

(BFS)?

A. Stack


B. Priority Queue


C. Binary Search Tree

,D. Queue


Answer: D


Conceptual Explanation: BFS uses a FIFO (First-In-First-Out) queue to track nodes that

have been discovered but not yet processed, ensuring nodes are visited level by level.


3. What is the primary difference between Dijkstra’s algorithm and the Bellman-Ford

algorithm?

A. Bellman-Ford can detect negative cycles and handle negative weights, while Dijkstra’s

cannot.


B. Dijkstra’s is only for undirected graphs.


C. Dijkstra’s can handle negative edge weights, while Bellman-Ford cannot.


D. Bellman-Ford is faster than Dijkstra’s for all graph types.


Answer: A


Conceptual Explanation: Bellman-Ford is more versatile as it can handle negative edge

weights and detect negative cycles, whereas Dijkstra’s requires all edge weights to be non-

negative.


4. In a max-heap, where is the largest element located?

A. At a leaf node


B. At the last index of the array


C. In the middle of the array

, D. At the root node


Answer: D


Conceptual Explanation: The defining property of a max-heap is that the parent node is

always greater than or equal to its children, meaning the largest value is always at the root.


5. What is the height of a balanced AVL tree with n nodes?

A. O(n)


B. O(log n)


C. O(n log n)


D. O(1)


Answer: B


Conceptual Explanation: AVL trees maintain a strict balance factor (difference in height of

subtrees is at most 1), ensuring the height remains logarithmic relative to the number of

nodes.


6. Which algorithm design paradigm does the Merge Sort algorithm follow?

A. Greedy


B. Divide and Conquer


C. Dynamic Programming


D. Backtracking

Document information

Uploaded on
July 31, 2026
Number of pages
24
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$15.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

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
TheStar
3.7
(140)
Sold
716
Followers
178
Items
27421
Last sold
3 days ago




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