Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1. Create a simple class with one member variable (minimum) and have this class implement the comparable interface in a logical way. Your class will
1. Create a simple class with one member variable (minimum) and have this class implement the comparable interface in a logical way. Your class will also need a constructor and a toString. 2. Create a driver class. a. Copy and paste the insertionSort, swap, and printArr methods from the methods_to_copy.txt file into Main.java. You will need to tweak some types a little and change a few statements to make use of the compareTo method instead of using , but basically the sorting method should work as is. b. In main, declare an array of size 5 to hold objects of your class from Step 1. c. Fill up this array with objects that are "out of order. d. Print the array to show that it's out of order. e. Call the insertion sort method on your array. f. Print out the array again to show that it's *in* order
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