Professional Documents
Culture Documents
Warning!
Adhere to the Code of Academic Integrity. You may discuss background
issues and general strategies with others and seek help from course instructor,
but the implementations that you submit must be your own. You are not
allowed to work out the detailed coding and solutions with others, copy code
from published/Internet sources or let others to do coding for you. If you
feel that you cannot complete the checkpoint on you own, seek help from the
course instructor.
DFS(G)
1
Algorithm 2 Depth-First Search Visit
DFS-VISIT(u)
1: color[u] ← GRAY
2: for each vertex v ∈ Adj[u] do
3: if color[v] = WHITE then
4: DFS-VISIT(v)
5: color[u] ← BLACK
Given the description and algorithms above, you are asked to implement DFS
algorithm and all tree arcs shall be coloured in green.
B C 1 D
1
1 1
1
A G
1 1 1
1
1
1 1
E 1 F 1 H
2
B C 1 D
1
1 1
1
A G
1 1 1
1
1
1 1
E 1 F 1 H
• Checkpoin4 class
• Graphs API
3
• Your Checkpoin4 class remains named as is.
2 Grading Policy
Practical part of this course worth 20 percent of the total course grade. How-
ever, each Checkpoint will be marked out according to the following criteria:
• Code style
4 Submission Instructions
• Upload Checkpoin4 class source file to the BlackBoard in the submis-
sion area corresponding to Checkpoint 4 as .java and another file .pdf.
• If you need to resubmit, fix all the problems prior due date and go back
to first point!
4
• In case of late submission (up to 2 days after due date), please contact
me via email. Otherwise you are done with this checkpoint. Well done!