Question
(Java coding language) You are going to construct a binary tree based on the Morse code representation for each letter of the alphabet. Complete it
(Java coding language) You are going to construct a binary tree based on the Morse code representation for each letter of the alphabet. Complete it in the following way: Start with a signal node that contains no letter. Then scan the code representation for letter and its code, building the tree by going left for a and right for a . This part of the project should be done manually (see below).
Your program will use this tree to decode Morse code into English. Your program will find the correct letter by scanning the string consisting with , -, and space by moving left on the tree for a and right for a -. In this way, the codes will be translated into English.
Note: to simply your program, each letter in input string will be separated by a space and each word will be separated by two spaces in the Morse code string. The string will end with the # symbol. For example, string __-__-_ _--_-# will be translated into Helen Gu. (_ stands for a space)
Code representation:
A - J --- S
B - K -- T
C -- L - U -
D - M -- V -
E N - W --
F - O --- X --
G -- P -- Y ---
H Q --- Z --
I R -
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