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
Answer To determine how many times the function wordScramble is called lets analyze the program ... View full answer
Get step-by-step solutions from verified subject matter experts
