Answered step by step
Verified Expert Solution
Question
1 Approved Answer
CSC 241 Lab 3 Given an unsorted ArrayList of Integer values, write a recursive method called smallestNumber that will find the smallest number within the
CSC 241 Lab 3 Given an unsorted ArrayList of Integer values, write a recursive method called smallestNumber that will find the smallest number within the ArrayList. The approach should use the fact that the smallest number in a subarray of the ArrayList is equal to the smaller of the first number in the subarray and the smallest number in the remainder of the subarray. The subarray will always contain the last item in the ArrayList. The method will take one parameter-the starting index of the subarray; it will also return the smallest number found. Create and test the smallestNumber method in a driver program given the following array -3,5, 1,-9,8, 16, 10, 4, 5,2,-1
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started