Question: If you look at decodeR() you will see a recursive solution, but it is also missing two statements - both of which are recursive calls

If you look at decodeR() you will see a recursive solution, but it is also missing two statements - both of which are recursive calls to the method. Implement decoder, so it takes morse code and returns a letter for it, using recursion in Java.

If you look at decodeR() you will see a recursive solution, but

it is also missing two statements - both of which are recursive

public class Decoder { private BinaryTreeNode root; public Decoder() { root = new BinaryTreeNode(""); // root node has no information // // A Recursive version of the decoder // private String decodeR(BinaryTreeNode n, String m) { String str="?"; if (n!=null) { if (m.length( )==0) str = n.getValue(); else if (m.charAt(0)=='.'). ;// Missing recursion here else if (m.charAt(0)=='-') ;// Missing recursion here } return str; } // public wrapper function to hide decoder() public String decode2(String m) { return decodeR(root, m); } A B C D E F G H I j K L M N 0 Q R s T U V W X Y z

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!