Application #1 The Morse code is a common code that is used to encode messages. In our application, we will assume that the messages contain letters only. Each letter consists of a series of dots (.)...

Application #1 The Morse code is a common code that is used to encode messages. In our application, we will assume that the messages contain letters only. Each letter consists of a series of dots (.) and underscores (); for example, the code for the letter a is and the code for the letter b is See the table below: Our program stores each letter of the alphabet in a binary tree. The root of the tree contains no letter. Its left node store the letter e (code is.), and its right node stores the letter t (code is _). The 4 nodes at the next level store the letters with code to build the tree we created a text file where each line consists of a letter and its code. The letters in the file are ordered by the tree level. The method build Morse Code Tree () creates the Morse Code Tree: Study the provided MorseCode.java and run the program. It has main method that prompts the user for a message encoded in Morse code and calls the decode method to decode the message and display the result. Your task is to implement the decode method. To find the position for a letter in the tree, scan the code and branch left for the dot and branch right for an underscore. Assume that the encoded letters are separated by spaces. Implement decode method defined in the MorseCode.java file.

May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here