void f3() - Perform a new traversal method to visit all nodes in the BST with the constraint: visit the nodes in the descending order of weight. The expected output in the file f3.txt should be the following:(T,8,-5) (M,7,2) (P,6,3) (R,5,9) (S,4,1) (L,2,5)
void f4() - Find the right most node of the tree. The expected output in the file f4.txt should be the following: (line 1: pre-order traversal, line 2: the right most node)(A,6,5) (B,2,7) (C,3,-8) (D,5,-3) (E,8,3) (G,7,4) (Q,9,1)
(Q,9,1)
void f5() - How many leaf nodes are there in the BST? The expected output in the file f5.txt should be the following: (line 1: in-order traversal, line 2: the amount of leaf nodes)(H,2,6) (Q,3,1) (D,4,3) (B,6,-4) (M,7,9) (X,8,7) (G,9,-6)
Zoom
100%
Close