(C,6,3) (D,3,2) (E,7,6) (F,2,4) (G,5,7) (H,4,5)
☑Kizspy.me
(C,6,3) (F,2,4) (E,7,6) (G,5,7) (H,4,5)
void f4() - Perform breadth-first traversal and find the first node p having color<6, then rotate p
to right. Output in the file f4.txt must be the following:
(C,6,3) (D,3,2) (E,7,6) (F,2,4) (G,5,7) (H,4,5)
(C,6,3) (F,2,4) (E,7,6) (D,3,2) (G,5,7) (H,4,5)
2
Quesion 3: (2 marks)
In this question you should complete some methods in Graph.java file.
The class Graph is the implementation of a graph. The following methods should be completed:
"
void f1()-Perform depth-first traversal (to the file f1.txt) from the vertex i-3 (the vertex D) but
display 4 vertices from the 3rd vertex to the 6th vertex only. Hint: copy depth(...) to depth2(...)
and modify the latter one. Content of the output file f1.txt must be:
DABEHICGF
BEHI
Zoom
+100%
Close