Browse W
Alphabetical listing with fast deep pagination.
66619 items • Page 1147 / 1333
Write a recursive method public static int teddy(int initial, int goal, int incr
Write a recursive method public static int teddy(int initial, int goal, int increment) that simulates a variant of the “Teddy Bears” game between the player (you) and your friend,…
Write a recursive method public static int teddy(int initial, int goal, int incr
Write a recursive method public static int teddy(int initial, int goal, int increment) that simulates a variant of the “Teddy Bears” game between the player (you) and your friend,…
Write a recursive method public static void replaceMult5(int[] nums, int newVal)
Write a recursive method public static void replaceMult5(int[] nums, int newVal) that replaces all multiples of 5 in the nums array with the argument newVal. Make no other changes…
Write a recursive method repeat that accepts a string s and an integer n as para
Write a recursive method repeat that accepts a string s and an integer n as parameters and that returns a String consisting of n copies of s. For example: You should solve this pr…
Write a recursive method repeat that accepts a string s and an integer n as para
Write a recursive method repeat that accepts a string s and an integer n as parameters and that returns a String consisting of n copies of s. For example: You should solve this pr…
Write a recursive method stringReverse that takes a character array containing a
Write a recursive method stringReverse that takes a character array containing a string as an argument and prints the string backward. [Hint: Using String method toCharArray, whic…
Write a recursive method that calculates the exponentiation function that given
Write a recursive method that calculates the exponentiation function that given integer two values (a, b), returns a raised to the b power. You may assume only positive values wil…
Write a recursive method that calculates the length of the collatz sequence for
Write a recursive method that calculates the length of the collatz sequence for a given input. The collatz sequence for an input may be calculated as follows. If the current value…
Write a recursive method that converts an integer into its English language Equi
Write a recursive method that converts an integer into its English language Equivalent. intToEnglish(4500007) -> four million five hundred thousand seven
Write a recursive method that counts the number of creatures on a grid. A creatu
Write a recursive method that counts the number of creatures on a grid. A creature is defined as a contiguous collection of 1's (connected horizontally vertically and diagonally).…
Write a recursive method that counts the number of creatures on a grid. A creatu
Write a recursive method that counts the number of creatures on a grid. A creature is defined as a contiguous collection of 1's (connected horizontally vertically and diagonally).…
Write a recursive method that counts the number of creatures on a grid. A creatu
Write a recursive method that counts the number of creatures on a grid. A creature is defined as a contiguous collection of 1's (connected horizontally vertically and diagonally).…
Write a recursive method that counts the number of creatures on a grid. An creat
Write a recursive method that counts the number of creatures on a grid. An creature is defined as a contiguous collection of 1's (connected horizontally and vertically). Input Max…
Write a recursive method that enumerates and prints all n-digit even numbers in
Write a recursive method that enumerates and prints all n-digit even numbers in which each digit of the number, from its most-significant to least-significant digits, is greater t…
Write a recursive method that finds the middle element of a linked list. That is
Write a recursive method that finds the middle element of a linked list. That is, if the list has n elements, the method returns the n/2 element. The method may not contain a loop…
Write a recursive method that generates a list of all possible character strings
Write a recursive method that generates a list of all possible character strings of a given length for a given numeric base. For example, generating all base 2 strings of length 3…
Write a recursive method that has one integer parameter (n) and returns the numb
Write a recursive method that has one integer parameter (n) and returns the number of binary strings of length n that do not have two consecutive 1's. You should not use any loops…
Write a recursive method that parses a binary number as a string into a decimal
Write a recursive method that parses a binary number as a string into a decimal integer. (String permutation) Write a recursive method to print all the permutations of a string. F…
Write a recursive method that prints the binary form of a given non-negative int
Write a recursive method that prints the binary form of a given non-negative integer, with the following specification: public class NPrint { public static void binaryPrint(int n)…
Write a recursive method that takes a String argument and recursively prints out
Write a recursive method that takes a String argument and recursively prints out each word in the String on a different line. Note: You will need to use methods such as indexOf() …
Write a recursive method that takes as a parameter a nonnegative integer and gen
Write a recursive method that takes as a parameter a nonnegative integer and generates the following pattern of stars. If the nonnegative inter is 4, then the pattern generated is…
Write a recursive method that takes as a parameter a nonnegative integer and gen
Write a recursive method that takes as a parameter a nonnegative integer and generates the following pattern of stars. If the nonnegative integer is 4, then the pattern generated …
Write a recursive method that takes as aparameter a non-negative integer and gen
Write a recursive method that takes as aparameter a non-negative integer and generates the followingpattern of stars. If the non-negative integer is 4, then thepattern generate…
Write a recursive method that takes two non-negative integers m and n as paramet
Write a recursive method that takes two non-negative integers m and n as parameters and returns the product. The method should not use the built-in multiplication operator: rather…
Write a recursive method that uses your compareTo(String, String) method to find
Write a recursive method that uses your compareTo(String, String) method to find the minimum (i.e. first by alphabetical order) String in an array of Strings, given the array and …
Write a recursive method that uses your compareTo(String, String) method to find
Write a recursive method that uses your compareTo(String, String) method to find the minimum (i.e. first by alphabetical order) String in an array of Strings, given the array and …
Write a recursive method that will find and list all of the one-element sequence
Write a recursive method that will find and list all of the one-element sequences of a letters in a char [] array, then all the two-element sequences, then all of the three elemen…
Write a recursive method to compute the following series: f(n)=1-1/2+1/3-1/4+…+(
Write a recursive method to compute the following series: f(n)=1-1/2+1/3-1/4+…+(-1)^(n+1) *1/n The recursive formula is: f(n)= f(n-1) + (-1)^(n+1) *1/n Use the class BigDecimal fo…
Write a recursive method to compute the following series: f(n)=1-1/2+1/3-1/4+…+(
Write a recursive method to compute the following series: f(n)=1-1/2+1/3-1/4+…+(-1)^(n+1) *1/n The recursive formula is: f(n)= f(n-1) + (-1)^(n+1) *1/n Use the class BigDecimal fo…
Write a recursive method to compute the greatest common divisor of two integers
Write a recursive method to compute the greatest common divisor of two integers m and n as follows The gcd(m, n) can he computed recursively as: If m % n is 0, then gcd(m, n) is n…
Write a recursive method to determine if an array of integers contains an intege
Write a recursive method to determine if an array of integers contains an integer that is the sum of two integers appearing earlier in the array; that is, for some i, A[i] = A[j]+…
Write a recursive method to meet this specification: public static boolean bears
Write a recursive method to meet this specification: public static boolean bears(int n) // Postcondition: A true return value means that it is possible // to win the bear game by …
Write a recursive method to print all the permutations of a string. For example,
Write a recursive method to print all the permutations of a string. For example, for a string abc, the printout is: abc acb bac bca cab cba Hint: Define the following two methods.…
Write a recursive method to reverse the values stored in an integer array. Place
Write a recursive method to reverse the values stored in an integer array. Place the method where indicated in the following program. Run the program and paste a screenshot of the…
Write a recursive method with method header void printArray(int[]a,int size) tha
Write a recursive method with method header void printArray(int[]a,int size) that prints the first size elements of array a on separate lines. -printArray(...) should check to mak…
Write a recursive method with the following specification and header: // Paramet
Write a recursive method with the following specification and header: // Parameters: m - number of asterisks in the first line // n - number of asterisks in the middle 2 lines // …
Write a recursive method, eval, to evaluate a postfix expression. The expression
Write a recursive method, eval, to evaluate a postfix expression. The expression is represented as a String and contains the following operators: +, -, * and /. For simplicity, as…
Write a recursive operation for takeAbsoluteValue. takeAbsoluteValue is a proced
Write a recursive operation for takeAbsoluteValue. takeAbsoluteValue is a procedure that applies the C++ abs(int x) operation to all Integers found in the sequence 's', all non-ne…
Write a recursive program (in Java) to solve the \"Missionaries and Cannibals\"
Write a recursive program (in Java) to solve the "Missionaries and Cannibals" problem. Three missionaries and three cannibals come to a river and find a boat that holds two. If th…
Write a recursive program to produce a pattern of n lines of dollar signs. The f
Write a recursive program to produce a pattern of n lines of dollar signs. The first line contains one dollar sign, the second contains 2, and so on up to the nth line, which cont…
Write a recursive python function int_log_base(base, number) that does the follo
Write a recursive python function int_log_base(base, number) that does the following: The integer log base x of y is the number of times you must divide y by x to get a number bet…
Write a recursive solution to solve the Partition problem. Partition: Given a se
Write a recursive solution to solve the Partition problem. Partition: Given a set A of n integers a, a, .....a., can you find a subset A_1 of integers such that the sum of the Int…
Write a recursive version horner_recursive m of horner.m. Test it on the polynom
Write a recursive version horner_recursive m of horner.m. Test it on the polynomial p and x values from Example 5.1, but with 1,000 terms instead of 100,000. Evaluate p(x) = sigma…
Write a recursive void function called rotateLeft that rotates the first n integ
Write a recursive void function called rotateLeft that rotates the first n integers in an array to the left. To rotate n items left, rotate the first n-1 items left recursively, …
Write a recursive, boolean -valued method named search that accepts an integer a
Write a recursive, boolean -valued method named search that accepts an integer array, the number of elements in the array, and an integer (in that order), and returns whether the …
Write a recursive, boolean -valued method named search that accepts an integer a
Write a recursive, boolean -valued method named search that accepts an integer array, the number of elements in the array, and an integer (in that order), and returns whether the …
Write a recursive, boolean -valued method named search that accepts an integer a
Write a recursive, boolean -valued method named search that accepts an integer array , the number of elements in the array , and an integer (in that order), and returns whether th…
Write a recursive, int -valued function named productOfOdds that accepts an inte
Write a recursive, int -valued function named productOfOdds that accepts an integer array, and the number of elements in the array and returns the product of the odd-valued elemen…
Write a recursive, int -valued function named productOfOdds that accepts an inte
Write a recursive, int -valued function named productOfOdds that accepts an integer array , and the number of elements in the array and returns the product of the odd-valued el…
Write a recursive, int -valued function, len, that accepts a string and returns
Write a recursive, int -valued function, len, that accepts a string and returns the number of characters in the string . The length of a string is: 0 if the string is the emp…