Question: Java code please 0 public class RecursionTestclass { 1 20 _3 * Here I have provided an example of one of the tests that I

Java code please

Java code please 0 public class RecursionTestclass { 1 20 _3 *Here I have provided an example of one of the tests that

0 public class RecursionTestclass { 1 20 _3 * Here I have provided an example of one of the tests that I 4 * would write. For each of your tests, leave a brief comment 5 * above the test specifying its purpose. For example, for this * test, I might write, "indexOf_testi tests when s2 is not a _7 * substring of s1. This should return -1.". */ ge @Test public void test_indexOf_test1() { 21 int result = Recursion.indexOf("Hello", "World"); 22 System.out.println("indexOf(Hello, World), got + result); 23 assertEquals(-1, result); 24 } 25 26 } 7 11 System.out.println(Recursion.indexOf("Hello", "10")); // 3 Stack stack = new Stack(); stack.push(2); stack.push(3); stack.push(4); stack.push(55); stack.push(6); stack.push(17); stack.push(); System.out.println(Recursion.removeEvenNumbers (stack, 2)); // 2 System.out.println(stack); // [2, 3, 4, 55, 17] System.out.println(Recursion.evenDigits (-1364035)); // 640 String expr = "(((1+2)*(3+1))+(1*(2+2)))"; Queue q = new LinkedList(); for (char ch: expr.toCharArray()) { q.add(ch); } System.out.println(Recursion.evaluate(q)); // 16 System.out.println(stack); // [2, 3, 4, 55, 17] Recursion.repeatStack(stack); System.out.println(stack); // [2, 2, 3, 3, 4, 4, 55, 55, 17, 17] Queue q2 = new LinkedList(); q2.add(34); 42.add(15); q2.add(0); Recursion.doubleElements(q2); System.out.println(92); [68, 30, 0] 0 public class RecursionTestclass { 1 20 _3 * Here I have provided an example of one of the tests that I 4 * would write. For each of your tests, leave a brief comment 5 * above the test specifying its purpose. For example, for this * test, I might write, "indexOf_testi tests when s2 is not a _7 * substring of s1. This should return -1.". */ ge @Test public void test_indexOf_test1() { 21 int result = Recursion.indexOf("Hello", "World"); 22 System.out.println("indexOf(Hello, World), got + result); 23 assertEquals(-1, result); 24 } 25 26 } 7 11 System.out.println(Recursion.indexOf("Hello", "10")); // 3 Stack stack = new Stack(); stack.push(2); stack.push(3); stack.push(4); stack.push(55); stack.push(6); stack.push(17); stack.push(); System.out.println(Recursion.removeEvenNumbers (stack, 2)); // 2 System.out.println(stack); // [2, 3, 4, 55, 17] System.out.println(Recursion.evenDigits (-1364035)); // 640 String expr = "(((1+2)*(3+1))+(1*(2+2)))"; Queue q = new LinkedList(); for (char ch: expr.toCharArray()) { q.add(ch); } System.out.println(Recursion.evaluate(q)); // 16 System.out.println(stack); // [2, 3, 4, 55, 17] Recursion.repeatStack(stack); System.out.println(stack); // [2, 2, 3, 3, 4, 4, 55, 55, 17, 17] Queue q2 = new LinkedList(); q2.add(34); 42.add(15); q2.add(0); Recursion.doubleElements(q2); System.out.println(92); [68, 30, 0]

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!