Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Material Type: Quiz; Class: OBJECT-ORIENTED PROG II; Subject: Computer Science; University: University of Maryland; Term: Unknown 1989;
Typology: Quizzes
1 / 2
CMSC 132 Quiz 5 Worksheet
The fifth quiz of the course will be on Monday, Apr 27 during your lab (discussion) session. The following list provides additional information about the quiz:
The quiz will be a written quiz (no computer). Closed book, closed notes quiz. Answers must be neat and legible. We recommend that you use pencil and eraser.
The following exercises cover the material to be included in this quiz. Solutions to these exercises will not be provided, but you are welcome to discuss your solutions with TAs and instructors.
Graph Problem I
Use the following graph to answer the questions below.
First Search (BFS) starting at vertex F. Pick nodes to visit using alphabetical order (when multiple choices are possible).
Search (DFS) starting at vertex F. Pick nodes to visit using alphabetical order (when multiple choices are possible).
for each node in the graph after processing 2 nodes ( A and another node). Remember to update the appropriate table entries after processing the 2nd^ node (after it has been added to the set of processed nodes). An empty table entry implies an infinite cost or no predecessor. Note: do not simply fill in the entire table with the final costs and predecessors instead of showing the table at the first two steps.
Graph Problem II
Use the following graph for the questions below.
For each of the following exercises, specify the order nodes are visited when performing the appropriate traversal. Pick nodes to visit using alphabetical order (when multiple choices are possible).
a. Apply DFS with A as the start node. b. Apply DFS with C as the start node (assuming edges are undirected). c. Apply BFS with D as the start node. d. Apply BFS with F as the start node (assuming edges are undirected).
For each of the following exercises, assume that all edges in the above graph are undirected.
a. Apply Dijkstra’s algorithm with A as the start node. List shortest path to F. b. Apply Dijkstra’s algorithm with B as the start node. List shortest path to F. c. Apply Dijkstra’s algorithm with E as the start node. List shortest path to C.