Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Quiz 4 Worksheet - Object-Oriented Program II | CMSC 132, Quizzes of Computer Science

Material Type: Quiz; Class: OBJECT-ORIENTED PROG II; Subject: Computer Science; University: University of Maryland; Term: Unknown 1989;

Typology: Quizzes

Pre 2010

Uploaded on 07/30/2009

koofers-user-736
koofers-user-736 🇺🇸

10 documents

Partial preview of the text

Download Quiz 4 Worksheet - Object-Oriented Program II | CMSC 132 and more Quizzes Computer Science in PDF only on Docsity!

CMSC 132 Quiz 4 Worksheet

The fourth quiz for the course will be on Wednesday, Nov 8, during your lab session. The following list provides more 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 the TA or instructor during office hours.

Exercises

Using the following graph answers the questions that follow. For BFS and DFS pick vertices to process using alphabetical order.

1. DFS/BFS

For each of the following exercises, specify the nodes visited after performing the appropriate traversal. When several node choices are available, use alphabetical order to choose a node to process.

a. Run DFS with A as the start vertex.

b. Run BFS with D as the start vertex.

  1. Dijkstra’s Algorithm

a. Run Dijkstra’s algorithm using A as the start vertex. Indicate the cost and predecessor for each node in the graph after completing the algorithm.

b. Run Dijkstra’s algorithm using B as the start vertex. Indicate the cost and predecessor for each node in the graph, after four nodes have been added to the set of processed nodes (set S in the lecture slides).

B

C D A F E 2