Lab 10: Tree solution

$17.99

Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment

Description

5/5 - (1 vote)

Introduction
In this lab, you are going to practice traversing a tree using recursion with a little of backtracking.
Recall that a path begins at the root and goes from node to node along the edges
that join them. Suppose we name a left edge ’0’ and the right edge ’1’ as shown in Figure
below:
a
b
c
d
e
g f
0
0 0 1 1
1
In doing so, we can represent a path by a string of 0s and 1s. For example, the path to the
node containing ’g’ is “01”, the path to the node containing ’b’ is “10”, the path to the
node containing ’c’ is “” (empty string), and so on.
What to Do?
For this lab, you are going to implement two methods marked TO DO in ShowPath.java.
In ShowPath.java, a tree of random unique characters is constructed using the method
generateTree(). This tree consists of characters from ’a’ to ’z’ and from ’A’ to ’Z’. The
method generateTree() will return the root node (of type BinaryNodeInterface