Question: For this assignment you must write the following functions using recursion: //Class A8Utils: // Print out 'n' *'s on the same line printStars(int n); //

For this assignment you must write the following functions using recursion:

//Class A8Utils:

// Print out 'n' *'s on the same line

printStars(int n);

// Return the minimum of the array

min(int[] numbers));

// Return Yes if pattern is found in target, No otherwise

isIn(String pattern, String target);

// Print all the permutations of word

permutations(String word);

// Return the number of permutations of word

countNumberOfPerms(word);

//main:

public class A8 { public static void main(String[] args) { A8Utils utils = new A8Utils(); utils.printStars(0); utils.printStars(5); int[] numbers = { 41, 0, 74, -1, 8, 37, 79, 5, 22, -17 }; System.out.println("Minumum is " + utils.min(numbers)); String[] patterns = { "al ", "Sta", "eat", "eac" }; for(int ii = 0; ii < patterns.length; ++ii) { System.out.println("Is pattern '" + patterns[ii] + "' in 'Cal State Long Beach'? " + utils.isIn(patterns[ii], "Cal State Long Beach")); } utils.permutations("1234"); utils.permutations("ios"); utils.countNumberOfPerms("LongBeach"); } }

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!