Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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.
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
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