Question
Java program using eclipse. TreeNode.java public class TreeNode { private T element; // data field private TreeNode left; // reference to left child node private
Java program using eclipse.
TreeNode.java
public class TreeNode
public TreeNode (T elem, TreeNode
morsecode.txt
e o t - i o o a o - n - o m - - s o o o u o o - r o - o w o - - d - o o k - o - g - - o o - - - h o o o o v o o o - f o o - o l o - o o p o - - o j o - - - b - o o o x - o o - c - o - o y - o - - z - - o o q - - o -
Part II (70 pts.) The Morse code is used to encode messages where each letter is coded as a unique series of dashes and dots. This problem will practice building a binary tree to store the alphabet letters. Code will use the TreeNode.java class built in lecture. The text file below lists each letter followed by its code. Files are on First Class. morsecode Notepad File Edit Format View Help e O 1 O O a O s o o o u O O r O W O O O h o o o o V O O O f o o 1 o O O p o O OO O O O O O Store each letter of the alphabet in a binary tree. The root node stores no letter. Travel to the left represents a dot and travel to the right represents a dash. Build the tree using the Morse code to travel left or right and then insert the letter. a. Initially the tree has a root node with no element. b. Read the first line of the text file: e o Letter e is represented by a single dot. Travel begins from the root. Dot means travel left. There is no left child encountered so make a node and insert letter e
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started