Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Implement these comparable methods listed in white to pass the given test code. The test code should not be changed but all methods should be
Implement these comparable methods listed in white to pass the given test code. The test code should not be changed but all methods should be implemented and pass.
Project must compile, otherwise no grade.
JavaDoc for Main class points
Tests passing for MainTest class hidden tests points
Test class as follows: import java.util.Arrays;
public class Main
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.util.Arrays;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
public class MainTest
private Main intData intData;
private Main doubleData doubleData;
@BeforeEach
public void setUp
intData new Mainnew Integer;
intData new Mainnew Integer;
doubleData new Mainnew Double;
doubleData new Mainnew Double;
@Test
public void testMergeSort
testHelperMergeSortintData;
testHelperMergeSortintData;
testHelperMergeSortdoubleData;
testHelperMergeSortdoubleData;
private void testHelperMergeSortMain data
T expected Arrays.copyOfdatadata, data.data.length;
Arrays.sortexpected;
assertArrayEqualsexpected data.mergeSort "MergeSort did not sort correctly";
@Test
public void testQuickSort
testHelperQuickSortintData;
testHelperQuickSortintData;
testHelperQuickSortdoubleData;
testHelperQuickSortdoubleData;
private void testHelperQuickSortMain data
T expected Arrays.copyOfdatadata, data.data.length;
Arrays.sortexpected;
assertArrayEqualsexpected data.quickSort "QuickSort did not sort correctly";
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