Plant ID: Plant 11-17-33 (G 11 N: 17 W 33) Plant ID: Plant 6-63-20 (G 6 N: 63 W:
ID: 3802159 • Letter: P
Question
Plant ID: Plant 11-17-33 (G 11 N: 17 W 33) Plant ID: Plant 6-63-20 (G 6 N: 63 W: 20) Plant ID Plant 61-75-17 (G: 61 N 75 W 17) Plant ID Plant 94-79-68 (G 94 N 79 W 68) Plant ID Plant 91-95-95 (G 91 N 95 W: 95 Plant ID: Plant 74-79-8 (G: 74 N: 79 W: 8 Plant ID: Plant 10-18-84 (G: 10 N 18 W Plant ID: Plant 46-62-28 (G 46 N 62 W 28) Plant ID: Plant 21-57 G: 21 W 6 Plant N 57 ID: Plant 90-0-32 (G 90 N: 0 W: 32) Plant ID Plant 10-78-12 (G 10 N 78 W 12) Plant ID Plant 33-5-93 (G 33 N 5 W 93) Plant ID: Plant 82-71-20 (G 82 N 71 W 2 Plant ID Plant 26-62-28 (G 26 N 62 W 2 Plant ID: Plant 58-20-72 (G 58 N 20 W 72) Plant ID: Plant 43-21-7 (G: 43 N 21 W: 7) Plant Plant ID Plant 74-32-48 (G 74 N: 32 W: 48 ID Plant 90-10-16 (G 90 N: 10 W 16) Plant ID Plant 47-11-1 (G 47 N 71 W 1) Plant ID Plant 50-99-36 (G 50 N 99 W 36) Plant ID Plant 7-95-21 (G 7 N 95 W 21) Plant ID Plant 2-2-88 (G 2 N 2 W: 88) Plant ID Plant 2-50-48 (G 2 N: 50 W: 48) Plant ID Plant 5-29-15 (G: 5 N: 29 W: 15) Plant ID Plant 82-28-52 (G 82 N 28 W 52) Plant ID Plant 62-52-8 (G 62 N 52 W Plant ID Plant 35-47-45 8) Plant ID Plant (G: 35 N 47 W 45) Plant ID: 58-67-8 (G 58 N 67 W 8) Plant Plant 58-70-16 (G: 58 N 70 W: 16) ID: Plant 58-20-12 (G: 58 N 20 W: 12) Plant ID Plant 43-21-93 (G 43 N: 21 W: 93) Plant ID: 74-32-72 (G: 74 N: 32 W: 72) Plant ID Plant 90-10-12 (G 90 N Plant ID: Plant 47-71-93 10 W: 12) Plant ID: Plant (G: 47 N: 71 w 93) Plant ID: 50-99-20 (G: 50 N 99 W: 20) Plant Plant 7-95-17 7 N: 95 W: 17) Plant ID: Plant 10-79-68 (G 10 N: 79 W 68 Plant ID: Plant ID Plant (G.Explanation / Answer
Hi,
A binary tree node in the below code sample would contain two values - key and data. Judging by your example, PlantId would be your key and the corresponding information (after the : ) would be your data.
I have written the recursive method (as requested) in C++ syntax
Note: Pass the root node of the constructed BinaryTree as the first parameter and the level of indentations (the level of the binary tree upto which you wish to recursively print the Plants as the second parameter of the method Indent(Treenode *node, int level) as below -----
-------------------------------------------------------------------------------------------------------------------
Indent(Treenode *node, int level){