Question: *JAVA* A binary tree can be generated automatically for desktop publishing by a program. You can write this program by assigning an x-y coordinate to
*JAVA*
A binary tree can be generated automatically for desktop publishing by a program. You can write this program by assigning an x-y coordinate to each tree node, drawing a circle around each coordinate, and connecting each nonroot node to its parent. Assume that you have a binary tree stored in memory and that each node has two extra data members for storing the coordinates. Assume that (0, 0) is the top-left corner. Do the following.
The y-coordinate can be computed by using the negative of the depth of the node. Write a routine to do so for each node in the tree.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
