Content of the file f4.txt:
(A,50,8) (Β,10,2) (C,4,5) (D,25,4) (J, 19,3) (G,7,6) (1,20,7) (E,30,10) (F,14,9) (H,34,11)
5
Void f5(0)- Reset age of all nodes locate in left branch of 1st node in preOrder traversal from root to zero(age=0).
(Hint: Traversal all nodes in left branch the node and set age of each node to 0.)
Content of the file f5.txt:
(B,10,2) (J,19,3) (D,25,4) (C,4,5) (G,7,6) (1,20,7) (A,50,8) (F,14,9) (E,30,10) (Η,34,11)
(B,0,2) (J,0,3) (D,0,4) (C,0,5) (G,0,6) (1,0,7) (A,50,8) (F,14,9) (E,30,10) (H,34,11)
Void f6()- Find the node which has biggest id (right most) node in the tree. The output of f6.txt is as follows:
Content of the file f6.txt:
(B,10,2) (1,19,3) (D,25,4) (C,4,5) (G,7,6) (1,20,7) (A,50,8) (F,14,9) (E,30,10) (H,34,11)
(H,34,11)