Question
Getting the Messages Note: Use Java to implement this The Morse code is A .- B - C -.-. D -.. E . F ..-.
Getting the Messages
Note: Use Java to implement this
The Morse code is
A .- | B -… | C -.-. | D -.. | E . | F ..-. | G --. |
H …. | I .. | J .--- | K -.- | L .-.. | M -- | N -. |
O --- | P .--. | Q --.- | R .-. | S … | T - | U ..- |
V …- | W .-- | X -..- | Y -.-- | Z --.. |
You have to write a program for an automatic decoder on the assumption that the raw input data has been preprocessed. In this preprocessed form, dots and dashes are represented by two-bit sequences, as indication of end of letter and end of word. These are shown in the table below
Symbol or delimiter | Two-bit sequence |
. | 01 |
- | 10 |
End of letter | 00 |
End of word | 11 |
The end of a sentence is denoted by two consecutive end of word sequences, i.e., 1111.
The data for your program will be therefore be entered as a sequence of bit pairs. For example, the message HELLO STOP I LOVE YOU STOP will be represented by the bit sequence
0101010100010001100101000110010100101010001111010100110110010100101010000101011000010011100110100010101000010110001111
In order to reduce searching time, the alphabetic characters should be stored using B+Tree or B*Tree. Make sure your program is well tested.
Step by Step Solution
3.44 Rating (160 Votes )
There are 3 Steps involved in it
Step: 1
SE Instead of storing alphabetic characters in B Tree or B Tree we store them in Hashmap MorseCodeDe...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