Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You are to write an application ( application is used here to mean program ) called ListMethods.java that does some useful things with
You are to write an application application is used here to mean "program" called ListMethods.java that does some useful things with arrays. In addition to the getInfo method, your program should have the following methods.
public int findMin that accepts a onedimensional array as a parameter and returns the smallest value in the array. If the array is empty size it returns Integer.MINVALUE.
public int findMinIndex that accepts a onedimensional array as a parameter and returns the index of the smallest value in the array. If the array is empty size it returns
public void reverse that accepts a onedimensional array as a parameter and reverses order of the array values. Hint: there are two approaches to this: swap the array valuesbut stop half way or you'll swap them back to their original position, or create a new array and copy the values into it in the reverse order from the original array, then copy the new reversed array back into the original array.
public boolean shiftUp that accepts a onedimensional array as a parameter and moves all values in the array from their current index to current index minus Note that the value in position is overwritten. The highest index is not overwritten ie the value at arrayarraylength will be duplicated in arrayarraylength The method should return true unless the array size is zero.
public boolean shiftDown that accepts a onedimensional array as a parameter and moves all values in the array from their current index to current index plus Note that the value in arrayarraylength is overwritten. The lowest index is not overwritten ie the value at array will be duplicated in array The method should return true unless the array size is zero.
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