Question: How many times is the function wordScramble() called in the given program? public class WordScramble { public static void wordScrarnble(String rem, String scr) { if

How many times is the function wordScramble() called in the given program?

public class WordScramble { public static void wordScrarnble(String rem, String scr) { if (rem.isEmpty()) { System.out.println(scr + rem); } else { for (int i= O; i < rem.length(); ++i) { wordScrarnble((rem.substring(O, i) + rem.substring(i + 1, rem.length())), (scr + rem.charAt(i))); } } }

public static void main(String args[]) {

wordScramble ( "ab" ," " ) ;

} }

Step by Step Solution

3.35 Rating (155 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Answer To determine how many times the function wordScramble is called lets analyze the program ... View full answer

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 Programming Questions!