Question: Recursive program in Java to find largest/smallest elements in an ArrayList: Write a program that reads a data file of doubles into an ArrayList and

Recursive program in Java to find largest/smallest elements in an ArrayList: Write a program that reads a data file of doubles into an ArrayList and prints the elements and the number of items read in.

Recursive program in Java to find largest/smallest elements in an ArrayList: Write

Lab.dat contains:

23.2 12.12 -6.43 18.0 91.6 74.2 100.87 61.0 13.76

program to find largest/smallest elements in an ArrayList: Write a program that reads a data file of doubles into an ArrayList and prints the elements and the number of items Recursive read in. 1. The name of the data file should be provided interactively. Do Not hard code the name of the data file. 2. Write a recursive function that returns the largest and smallest elements in the ArrayList and the corresponding indices. To return these four items, you need to return an object that is an instance of an inner class called MinMaxObject that you will define to contain four private variables maz, min, mazPos, minPos of types double, double, int and int respectively

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!