100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

PRG 420 Java Programming I - Finals Mock Exam Review - UOPX 2025.

Rating
-
Sold
-
Pages
37
Uploaded on
28-05-2025
Written in
2024/2025

PRG 420 Java Programming I - Finals Mock Exam Review - UOPX 2025.PRG 420 Java Programming I - Finals Mock Exam Review - UOPX 2025.PRG 420 Java Programming I - Finals Mock Exam Review - UOPX 2025.












Whoops! We can’t load your doc right now. Try again or contact support.

Document information

Uploaded on
May 28, 2025
Number of pages
37
Written in
2024/2025
Type
Exam (elaborations)
Contains
Unknown

Subjects

Content preview

PRG 420 Java Programming I

Finals Mock Exam Review

(Questions & Solutions)

2025




©2025

, Question 1:
A software engineer needs a self-balancing binary search tree that
provides faster lookup speeds by enforcing strict balance but may require
more frequent rotations during insertions and deletions. Which data
structure best meets these criteria?
- A. Red‑Black Tree
- B. AVL Tree
- C. Splay Tree
- D. Treap

ANS: B. AVL Tree
Rationale: AVL trees maintain a stricter balance (the height difference
between left and right subtrees is at most one), which yields faster
lookups compared to red‑black trees. However, this strict balancing
sometimes cost more rotations during insertions and deletions.

---

Question 2:
For implementing an efficient priority queue where operations such as
insertion and extract‑min must be performed frequently, which data
structure is most effective?
- A. Binary search tree
- B. Binary heap
- C. Linked list
- D. Hash table

ANS: B. Binary heap
Rationale: Binary heaps provide O(log n) insertion and deletion
(extract‑min or extract‑max) time, making them ideal for implementing
priority queues where such operations are frequent.

---
©2025

, Question 3:
In applications such as search engines and autocomplete systems, which
data structure is best suited for efficient prefix-based searches?
- A. Hash table
- B. Trie
- C. Binary search tree
- D. Graph

ANS: B. Trie
Rationale: Tries (prefix trees) are designed to store strings in a tree-like
structure, enabling very fast prefix searches. Although hash tables are
efficient for exact matches, they are not inherently designed for prefix
queries.

---

Question 4:
Which data structure is the optimal choice for implementing an
associative array (dictionary) that supports average-case constant-time
search, insertion, and deletion, assuming a well-designed hash function?
- A. Binary search tree
- B. Trie
- C. Hash table
- D. Skip list

ANS: C. Hash table
Rationale: Hash tables generally provide average-case O(1) operations
for search, insertion, and deletion when collisions are minimized by a
good hash function.

---

Question 5:
A project calls for dynamic maintenance of a sorted order of elements
©2025

, along with support for rank queries (e.g., finding the kth smallest
element) in O(log n) time. Which augmented data structure meets these
requirements?
- A. Order-statistic tree
- B. R-Tree
- C. Splay tree
- D. Linked list

ANS: A. Order-statistic tree
Rationale: Order-statistic trees are augmented binary search trees
(often based on red‑black trees) that store subtree sizes, enabling
efficient rank queries and selection operations.

---

Question 6:
Which data structure is most commonly used to implement the Depth-
First Search (DFS) algorithm in graph traversal?
- A. Queue
- B. Stack
- C. Priority queue
- D. Hash table

ANS: B. Stack
Rationale: DFS can be implemented using either recursion (implicitly
using the call stack) or an explicit stack data structure to keep track of
nodes to be visited.

---

Question 7:
To resolve collisions in a hash table, one common technique involves
maintaining a linked list of entries for each hash bucket. This method is
known as:
- A. Open addressing
©2025

Get to know the seller

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.
MedGrad Walden University
View profile
Follow You need to be logged in order to follow users or courses
Sold
29
Member since
2 year
Number of followers
10
Documents
3344
Last sold
1 week ago

Hi there! I'm a former nursing student who loves to share my knowledge and help others succeed. On this account, you'll find my past study notes and papers for nursing and other programs that I've taken or reviewed. They are high-quality, well-organized and easy to understand. Whether you need a quick refresher, a detailed explanation or a sample essay, I've got you covered. Follow me and get access to the best resources for your studies. Trust me, you won't regret it!

Read more Read less
2.6

5 reviews

5
0
4
0
3
3
2
2
1
0

Recently viewed by you

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

Frequently asked questions