Write BstShape: insert the integers of the input in a binary search tree (duplicates are ignored), then print
- the number of nodes and the height (the number of nodes on the longest path from the root to a leaf; 0 for an empty tree);
- the number of leaves and of internal nodes;
- the tree level by level (breadth-first traversal with a queue), one line per level;
- the size of the widest level.
height, size and leaves are recursive; the level-by-level traversal is not. For the input
50 30 70 20 40 60 80 35 45 65
the program prints
Nodes: 10, height: 4
Leaves: 5, internal nodes: 5
Level 0: 50
Level 1: 30 70
Level 2: 20 40 60 80
Level 3: 35 45 65
Widest level: 4 node(s)