(C,8,2) (D,6,1) (E,9,4) (6,7,8) (1,5,5)
void f3() - Suppose p is the 4-th node when performing the post-order traversal of the tree and f is the father of p. Delete the node f by copying. Output in the file f3.txt must be the following:(D,6,1) (F,2,3) (K,4,6) (J,5,5) (H,1,7) (1,3,9) (G,7,8) (E,9,4) (C,8,2)
(D,6,1) (F,2,3) (Κ,4,6) (J,5,5) (1,3,9) (G,7,8) (E,9,4) (C,8,2)
void f4() - Suppose p is the 4-th node when performing the post-order traversal of the tree. Calculate the height of sub-tree with root p and suppose this height is k, then set p.info.ratek. Output in the file f4.txt must be the following:(D,6,1) (F,2,3) (Κ,4,6) (J,5,5) (H,1,7) (1,3,9) (G,7,8) (E,9,4) (C,8,2)
(D,6,1) (F,2,3) (Κ,4,6) (J,2,5) (H,1,7) (1,3,9) (G,7,8) (E,9,4) (C,8,2)
2
Question 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:
Zoom
100%
Close