Write a function in Java called factorial()
that will take a positive integer as input and returns its factorial as output.
CW-Comparing_Objects_Search/Sort
Score: 0 / 35.0
Exercises
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...
Given a string, compute the number of times lowercase "hi" appears in the string. Make the countHi
be recursive.
Write the missing base case for function largest
. Function largest
should find the largest number in array numbers
. When largest
is first...
For function sumtok
, write the missing recursive call. This function returns the sum of the values from 1 to k
.
The following method is a Selection Sort method. Within the method, there is an error on one line. You job is to find that line and fix...
Write a method quicksort that takes in an ArrayList of integers and returns them in ascending order, using a quicksort style of sorting....