Write the missing base case for function largest
. Function largest
should find the largest number in array numbers
. When largest
is first...
CW-Recursion_Practices
Score: 0 / 20.0
Exercises
0
/ 4.0
0
/ 3.0
Write a function in Java called factorial()
that will take a positive integer as input and returns its factorial as output.
0
/ 3.0
Given a non-negative int n
, return the sum of its digits recursively (no loops). Note that mod (%
) by 10 yields the rightmost digit (126...
0
/ 3.0
Given a string, compute the number of times lowercase "hi" appears in the string. Make the countHi
be recursive.
0
/ 3.0
For function multiply
, write the missing base case condition and action. This function will multiply two numbers x
and y
. You can assume...
0
/ 4.0
The greatest common divisor (GCD) for a pair of numbers is the largest positive integer that divides both numbers without remainder. For...