SlideShare a Scribd company logo
2
Most read
3
Most read
4
Most read
Step 1: Implement the getSortedRunLength() method
Implement the getSortedRunLength() method in NaturalMergeSorter.java. Access
NaturalMergeSorter.java by clicking on the orange arrow next to NaturalMerge.java at the top of
the coding window.
getSortedRunLength() has three parameters:
array: a reference to an array of integers,
arrayLength: an integer for the array's length, and
startIndex: an integer for the run's starting index.
The method returns the number of array elements sorted in ascending order, starting at startIndex
and ending either at the end of the sorted run, or the end of the array, whichever comes first. The
method returns 0 if startIndex is out of bounds.
File NaturalMerge.java has several test cases for getSortedRunLength() that can be run by
clicking the "Run program" button. One test case also exists for naturalMergeSort(), but that can
be ignored until step two is completed.
The program's output does not affect grading.
Submit for grading to ensure that the getSortedRunLength() unit tests pass before proceeding.
Step 2: Implement the naturalMergeSort() method
Implement the naturalMergeSort() method in NaturalMergeSorter.java. naturalMergeSort() must:
Start at index i=0
Get the length of the first sorted run, starting at i
Return if the first run's length equals the array length
If the first run ends at the array's end, reassign i=0 and repeat step 2
Get the length of the second sorted run, starting immediately after the first
Merge the two runs with the provided merge() method
Reassign i with the first index after the second run, or 0 if the second run ends at the array's end
Go to step 2
NaturalMergeSorter.java
public class NaturalMergeSorter {
public static int getSortedRunLength(int[] array, int arrayLength, int startIndex) {
if (startIndex < 0 || startIndex >= arrayLength) {
return 0;
}
int length = 1;
for (int i = startIndex + 1; i < arrayLength; i++) {
if (array[i] >= array[i - 1]) {
length++;
} else {
break;
}
}
return length;
}
public static int getSortedRunLength(double[] array, int arrayLength, int startIndex) {
if (startIndex < 0 || startIndex >= arrayLength) {
return 0;
}
int length = 1;
for (int i = startIndex + 1; i < arrayLength; i++) {
if (array[i] >= array[i - 1]) {
length++;
} else {
break;
}
}
return length;
}
public static void naturalMergeSort(int[] array, int arrayLength) {
int i = 0;
while (i < arrayLength) {
int firstRunLength = getSortedRunLength(array, arrayLength, i);
if (firstRunLength == arrayLength) {
return;
}
int secondRunLength = getSortedRunLength(array, arrayLength, i + firstRunLength);
merge(array, i, i + firstRunLength - 1, i + firstRunLength + secondRunLength - 1);
if (i + firstRunLength + secondRunLength == arrayLength) {
i = 0;
} else {
i = i + firstRunLength + secondRunLength;
}
}
}
public static void naturalMergeSort(double[] array, int arrayLength) {
int i = 0;
while (i < arrayLength) {
int firstRunLength = getSortedRunLength(array, arrayLength, i);
if (firstRunLength == arrayLength) {
return;
}
int secondRunLength = getSortedRunLength(array, arrayLength, i + firstRunLength);
merge(array, i, i + firstRunLength - 1, i + firstRunLength + secondRunLength - 1);
if (i + firstRunLength + secondRunLength == arrayLength) {
i = 0;
} else {
i = i + firstRunLength + secondRunLength;
}
}
}
public static void merge(int[] numbers, int leftFirst, int leftLast, int rightLast) {
int mergedSize = rightLast - leftFirst + 1;
int[] mergedNumbers = new int[mergedSize];
int mergePos = 0;
int leftPos = leftFirst;
int rightPos = leftLast + 1;
// Add smallest element from left or right partition to merged numbers
while (leftPos <= leftLast && rightPos <= rightLast) {
if (numbers[leftPos] <= numbers[rightPos]) {
mergedNumbers[mergePos] = numbers[leftPos];
leftPos++;
} else {
mergedNumbers[mergePos] = numbers[rightPos];
rightPos++;
}
mergePos++;
}
// If left partition isn't empty, add remaining elements to mergedNumbers
while (leftPos <= leftLast) {
mergedNumbers[mergePos] = numbers[leftPos];
leftPos++;
mergePos++;
}
// If right partition isn't empty, add remaining elements to mergedNumbers
while (rightPos <= rightLast) {
mergedNumbers[mergePos] = numbers[rightPos];
rightPos++;
mergePos++;
}
// Copy merged numbers back to numbers
for (mergePos = 0; mergePos < mergedSize; mergePos++) {
numbers[leftFirst + mergePos] = mergedNumbers[mergePos];
}
// Free temporary array
mergedNumbers = null;
}
public static void merge(double[] numbers, int leftFirst, int leftLast, int rightLast) {
int mergedSize = rightLast - leftFirst + 1;
double[] mergedNumbers = new double[mergedSize];
int mergePos = 0;
int leftPos = leftFirst;
int rightPos = leftLast + 1;
// Add smallest element from left or right partition to merged numbers
while (leftPos <= leftLast && rightPos <= rightLast) {
if (numbers[leftPos] <= numbers[rightPos]) {
mergedNumbers[mergePos] = numbers[leftPos];
leftPos++;
} else {
mergedNumbers[mergePos] = numbers[rightPos];
rightPos++;
}
mergePos++;
}
// If left partition isn't empty, add remaining elements to mergedNumbers
while (leftPos <= leftLast) {
mergedNumbers[mergePos] = numbers[leftPos];
leftPos++;
mergePos++;
}
// If right partition isn't empty, add remaining elements to mergedNumbers
while (rightPos <= rightLast) {
mergedNumbers[mergePos] = numbers[rightPos];
rightPos++;
mergePos++;
}
// Copy merged numbers back to numbers
for (mergePos = 0; mergePos < mergedSize; mergePos++) {
numbers[leftFirst + mergePos] = mergedNumbers[mergePos];
}
// Free temporary array
mergedNumbers = null;
}
}
The errors I've received. Please fix the code and explain what happened.
3:NaturalMergeSort() unit testkeyboard_arrow_up
0 / 1
Compilation failed
Compilation failed
./GradingSorter.java:17: error: getSortedRunLength(int[],int,int) in GradingSorter cannot
override getSortedRunLength(int[],int,int) in NaturalMergeSorter public int
getSortedRunLength(int[] array, int arrayLength, int startIndex) { ^ overridden method is static
./GradingSorter.java:16: error: method does not override or implement a method from a
supertype @Override ^ ./GradingSorter.java:30: error: merge(int[],int,int,int) in GradingSorter
cannot override merge(int[],int,int,int) in NaturalMergeSorter public void merge(int[] array, int
leftFirst, int leftLast, int rightLast) { ^ overridden method is static ./GradingSorter.java:29: error:
method does not override or implement a method from a supertype @Override ^
./GradingSorter.java:54: error: naturalMergeSort(int[],int) in GradingSorter cannot override
naturalMergeSort(int[],int) in NaturalMergeSorter public void naturalMergeSort(int[] array, int
arrayLength) { ^ overridden method is static ./GradingSorter.java:53: error: method does not
override or implement a method from a supertype @Override ^ 6 errors
4:NaturalMergeSort() unit testkeyboard_arrow_up
0 / 1
Compilation failed
Compilation failed
./GradingSorter.java:17: error: getSortedRunLength(int[],int,int) in GradingSorter cannot
override getSortedRunLength(int[],int,int) in NaturalMergeSorter public int
getSortedRunLength(int[] array, int arrayLength, int startIndex) { ^ overridden method is static
./GradingSorter.java:16: error: method does not override or implement a method from a
supertype @Override ^ ./GradingSorter.java:30: error: merge(int[],int,int,int) in GradingSorter
cannot override merge(int[],int,int,int) in NaturalMergeSorter public void merge(int[] array, int
leftFirst, int leftLast, int rightLast) { ^ overridden method is static ./GradingSorter.java:29: error:
method does not override or implement a method from a supertype @Override ^
./GradingSorter.java:54: error: naturalMergeSort(int[],int) in GradingSorter cannot override
naturalMergeSort(int[],int) in NaturalMergeSorter public void naturalMergeSort(int[] array, int
arrayLength) { ^ overridden method is static ./GradingSorter.java:53: error: method does not
override or implement a method from a supertype @Override ^ 6 errors
5:NaturalMergeSort() unit testkeyboard_arrow_up
0 / 5
Five more test cases
Compilation failed
Compilation failed
./GradingSorter.java:17: error: getSortedRunLength(int[],int,int) in GradingSorter cannot
override getSortedRunLength(int[],int,int) in NaturalMergeSorter public int
getSortedRunLength(int[] array, int arrayLength, int startIndex) { ^ overridden method is static
./GradingSorter.java:16: error: method does not override or implement a method from a
supertype @Override ^ ./GradingSorter.java:30: error: merge(int[],int,int,int) in GradingSorter
cannot override merge(int[],int,int,int) in NaturalMergeSorter public void merge(int[] array, int
leftFirst, int leftLast, int rightLast) { ^ overridden method is static ./GradingSorter.java:29: error:
method does not override or implement a method from a supertype @Override ^
./GradingSorter.java:54: error: naturalMergeSort(int[],int) in GradingSorter cannot override
naturalMergeSort(int[],int) in NaturalMergeSorter public void naturalMergeSort(int[] array, int
arrayLength) { ^ overridden method is static ./GradingSorter.java:53: error: method does not
override or implement a method from a supertype @Override ^ 6 errors
Step 1 Implement the getSortedRunLength() methodImplement the get.pdf

More Related Content

PDF
JAVALAB #8 - ARRAY BASED LISTSThe next exercise is based on this.pdf
PPT
Mixing functional and object oriented approaches to programming in C#
PPT
Mixing Functional and Object Oriented Approaches to Programming in C#
PPTX
Merge sort
PDF
Step 1You need to run the JAVA programs in sections 3.3 and 3.5 for.pdf
PPT
PDF
Create a menu-driven program that will accept a collection of non-ne.pdf
PDF
There are a couple of new methods that you will be writing for this pr.pdf
JAVALAB #8 - ARRAY BASED LISTSThe next exercise is based on this.pdf
Mixing functional and object oriented approaches to programming in C#
Mixing Functional and Object Oriented Approaches to Programming in C#
Merge sort
Step 1You need to run the JAVA programs in sections 3.3 and 3.5 for.pdf
Create a menu-driven program that will accept a collection of non-ne.pdf
There are a couple of new methods that you will be writing for this pr.pdf

Similar to Step 1 Implement the getSortedRunLength() methodImplement the get.pdf (20)

PDF
Assignment of Advanced data structure and algorithms..pdf
PDF
Assignment of Advanced data structure and algorithms ..pdf
PDF
Assignment of Advanced data structure and algorithm ..pdf
PPT
9781439035665 ppt ch09
DOCX
object oriented programming lab manual .docx
DOCX
QA Auotmation Java programs,theory
PPTX
Chapter 7.1
PPTX
Mixing functional programming approaches in an object oriented language
PPTX
6_Array.pptx
PDF
Java Algorithm Interview Questions & Answers .pdf
PDF
Groovy Refactoring Patterns
PPT
Chapter 3 Arrays in Java
PDF
Write a method called uniqueNumbers that takes an int array as param.pdf
PDF
JavaScript Array Interview Questions PDF By ScholarHat
PDF
2.(Sorted list array implementation)This sorted list ADT discussed .pdf
PPTX
Bubble sort, Selection sort SORTING .pptx
PDF
Sorting_Algoritm-computee-scienceggn.pdf
PPT
14-sorting.ppt
PPT
14-sorting (3).ppt
PPT
14-sorting.ppt
Assignment of Advanced data structure and algorithms..pdf
Assignment of Advanced data structure and algorithms ..pdf
Assignment of Advanced data structure and algorithm ..pdf
9781439035665 ppt ch09
object oriented programming lab manual .docx
QA Auotmation Java programs,theory
Chapter 7.1
Mixing functional programming approaches in an object oriented language
6_Array.pptx
Java Algorithm Interview Questions & Answers .pdf
Groovy Refactoring Patterns
Chapter 3 Arrays in Java
Write a method called uniqueNumbers that takes an int array as param.pdf
JavaScript Array Interview Questions PDF By ScholarHat
2.(Sorted list array implementation)This sorted list ADT discussed .pdf
Bubble sort, Selection sort SORTING .pptx
Sorting_Algoritm-computee-scienceggn.pdf
14-sorting.ppt
14-sorting (3).ppt
14-sorting.ppt
Ad

More from aloeplusint (20)

PDF
Starware Software was founded last year to develop software for gami.pdf
PDF
Some obstacles in Project Development. One of the main goals of Proj.pdf
PDF
Sophocles Enterprises had the following pretax income (loss) over it.pdf
PDF
Solve using java and using this Singly linked list classpublic cl.pdf
PDF
SQL was created at IBM in the 1970s. Why was SQL createdSQL was .pdf
PDF
SQL- Write a select statement that returns the Freight cost from.pdf
PDF
Some of our most basic questions about the history of life concern w.pdf
PDF
Southeastern Oklahoma State Universitys business program has the fa.pdf
PDF
Sorensen Systems Inc. is expected to pay a $2.50 dividend at year en.pdf
PDF
Subject Computer Architecture & Organization Q-4 Assume that .pdf
PDF
Subject Management Information System Please complete the four qu.pdf
PDF
Subject Computer Architecture & Organization i. Show the con.pdf
PDF
Solve the following balance and income sheet for this specialty hosp.pdf
PDF
Su clase se ha ofrecido como voluntaria para trabajar por el Refer�n.pdf
PDF
Su compa��a de TI es responsable de crear programas de virus de soft.pdf
PDF
Study the cladogram above and match the names of the five organisms .pdf
PDF
study of tension, compression, and shear and compare those three dir.pdf
PDF
Start Program like this Chapter 7 Validate Password import.pdf
PDF
Students may research the local Aboriginal andor Torres Strait Isla.pdf
PDF
Stevie es un hombre ocupado. El viaja mucho. Usa las palabras entre .pdf
Starware Software was founded last year to develop software for gami.pdf
Some obstacles in Project Development. One of the main goals of Proj.pdf
Sophocles Enterprises had the following pretax income (loss) over it.pdf
Solve using java and using this Singly linked list classpublic cl.pdf
SQL was created at IBM in the 1970s. Why was SQL createdSQL was .pdf
SQL- Write a select statement that returns the Freight cost from.pdf
Some of our most basic questions about the history of life concern w.pdf
Southeastern Oklahoma State Universitys business program has the fa.pdf
Sorensen Systems Inc. is expected to pay a $2.50 dividend at year en.pdf
Subject Computer Architecture & Organization Q-4 Assume that .pdf
Subject Management Information System Please complete the four qu.pdf
Subject Computer Architecture & Organization i. Show the con.pdf
Solve the following balance and income sheet for this specialty hosp.pdf
Su clase se ha ofrecido como voluntaria para trabajar por el Refer�n.pdf
Su compa��a de TI es responsable de crear programas de virus de soft.pdf
Study the cladogram above and match the names of the five organisms .pdf
study of tension, compression, and shear and compare those three dir.pdf
Start Program like this Chapter 7 Validate Password import.pdf
Students may research the local Aboriginal andor Torres Strait Isla.pdf
Stevie es un hombre ocupado. El viaja mucho. Usa las palabras entre .pdf
Ad

Recently uploaded (20)

DOC
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
PPTX
UV-Visible spectroscopy..pptx UV-Visible Spectroscopy – Electronic Transition...
PDF
Classroom Observation Tools for Teachers
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PDF
LDMMIA Reiki Yoga Finals Review Spring Summer
PDF
Weekly quiz Compilation Jan -July 25.pdf
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PPTX
UNIT III MENTAL HEALTH NURSING ASSESSMENT
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PDF
What if we spent less time fighting change, and more time building what’s rig...
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
UV-Visible spectroscopy..pptx UV-Visible Spectroscopy – Electronic Transition...
Classroom Observation Tools for Teachers
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
LDMMIA Reiki Yoga Finals Review Spring Summer
Weekly quiz Compilation Jan -July 25.pdf
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
UNIT III MENTAL HEALTH NURSING ASSESSMENT
Module 4: Burden of Disease Tutorial Slides S2 2025
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Chinmaya Tiranga quiz Grand Finale.pdf
Microbial diseases, their pathogenesis and prophylaxis
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Final Presentation General Medicine 03-08-2024.pptx
202450812 BayCHI UCSC-SV 20250812 v17.pptx
What if we spent less time fighting change, and more time building what’s rig...
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE

Step 1 Implement the getSortedRunLength() methodImplement the get.pdf

  • 1. Step 1: Implement the getSortedRunLength() method Implement the getSortedRunLength() method in NaturalMergeSorter.java. Access NaturalMergeSorter.java by clicking on the orange arrow next to NaturalMerge.java at the top of the coding window. getSortedRunLength() has three parameters: array: a reference to an array of integers, arrayLength: an integer for the array's length, and startIndex: an integer for the run's starting index. The method returns the number of array elements sorted in ascending order, starting at startIndex and ending either at the end of the sorted run, or the end of the array, whichever comes first. The method returns 0 if startIndex is out of bounds. File NaturalMerge.java has several test cases for getSortedRunLength() that can be run by clicking the "Run program" button. One test case also exists for naturalMergeSort(), but that can be ignored until step two is completed. The program's output does not affect grading. Submit for grading to ensure that the getSortedRunLength() unit tests pass before proceeding. Step 2: Implement the naturalMergeSort() method Implement the naturalMergeSort() method in NaturalMergeSorter.java. naturalMergeSort() must: Start at index i=0 Get the length of the first sorted run, starting at i Return if the first run's length equals the array length If the first run ends at the array's end, reassign i=0 and repeat step 2 Get the length of the second sorted run, starting immediately after the first Merge the two runs with the provided merge() method Reassign i with the first index after the second run, or 0 if the second run ends at the array's end Go to step 2 NaturalMergeSorter.java public class NaturalMergeSorter { public static int getSortedRunLength(int[] array, int arrayLength, int startIndex) { if (startIndex < 0 || startIndex >= arrayLength) { return 0; } int length = 1; for (int i = startIndex + 1; i < arrayLength; i++) { if (array[i] >= array[i - 1]) {
  • 2. length++; } else { break; } } return length; } public static int getSortedRunLength(double[] array, int arrayLength, int startIndex) { if (startIndex < 0 || startIndex >= arrayLength) { return 0; } int length = 1; for (int i = startIndex + 1; i < arrayLength; i++) { if (array[i] >= array[i - 1]) { length++; } else { break; } } return length; } public static void naturalMergeSort(int[] array, int arrayLength) { int i = 0; while (i < arrayLength) { int firstRunLength = getSortedRunLength(array, arrayLength, i); if (firstRunLength == arrayLength) { return; } int secondRunLength = getSortedRunLength(array, arrayLength, i + firstRunLength); merge(array, i, i + firstRunLength - 1, i + firstRunLength + secondRunLength - 1); if (i + firstRunLength + secondRunLength == arrayLength) { i = 0; } else { i = i + firstRunLength + secondRunLength; } }
  • 3. } public static void naturalMergeSort(double[] array, int arrayLength) { int i = 0; while (i < arrayLength) { int firstRunLength = getSortedRunLength(array, arrayLength, i); if (firstRunLength == arrayLength) { return; } int secondRunLength = getSortedRunLength(array, arrayLength, i + firstRunLength); merge(array, i, i + firstRunLength - 1, i + firstRunLength + secondRunLength - 1); if (i + firstRunLength + secondRunLength == arrayLength) { i = 0; } else { i = i + firstRunLength + secondRunLength; } } } public static void merge(int[] numbers, int leftFirst, int leftLast, int rightLast) { int mergedSize = rightLast - leftFirst + 1; int[] mergedNumbers = new int[mergedSize]; int mergePos = 0; int leftPos = leftFirst; int rightPos = leftLast + 1; // Add smallest element from left or right partition to merged numbers while (leftPos <= leftLast && rightPos <= rightLast) { if (numbers[leftPos] <= numbers[rightPos]) { mergedNumbers[mergePos] = numbers[leftPos]; leftPos++; } else { mergedNumbers[mergePos] = numbers[rightPos]; rightPos++; }
  • 4. mergePos++; } // If left partition isn't empty, add remaining elements to mergedNumbers while (leftPos <= leftLast) { mergedNumbers[mergePos] = numbers[leftPos]; leftPos++; mergePos++; } // If right partition isn't empty, add remaining elements to mergedNumbers while (rightPos <= rightLast) { mergedNumbers[mergePos] = numbers[rightPos]; rightPos++; mergePos++; } // Copy merged numbers back to numbers for (mergePos = 0; mergePos < mergedSize; mergePos++) { numbers[leftFirst + mergePos] = mergedNumbers[mergePos]; } // Free temporary array mergedNumbers = null; } public static void merge(double[] numbers, int leftFirst, int leftLast, int rightLast) { int mergedSize = rightLast - leftFirst + 1; double[] mergedNumbers = new double[mergedSize]; int mergePos = 0; int leftPos = leftFirst; int rightPos = leftLast + 1; // Add smallest element from left or right partition to merged numbers while (leftPos <= leftLast && rightPos <= rightLast) { if (numbers[leftPos] <= numbers[rightPos]) { mergedNumbers[mergePos] = numbers[leftPos]; leftPos++; } else { mergedNumbers[mergePos] = numbers[rightPos]; rightPos++; }
  • 5. mergePos++; } // If left partition isn't empty, add remaining elements to mergedNumbers while (leftPos <= leftLast) { mergedNumbers[mergePos] = numbers[leftPos]; leftPos++; mergePos++; } // If right partition isn't empty, add remaining elements to mergedNumbers while (rightPos <= rightLast) { mergedNumbers[mergePos] = numbers[rightPos]; rightPos++; mergePos++; } // Copy merged numbers back to numbers for (mergePos = 0; mergePos < mergedSize; mergePos++) { numbers[leftFirst + mergePos] = mergedNumbers[mergePos]; } // Free temporary array mergedNumbers = null; } } The errors I've received. Please fix the code and explain what happened. 3:NaturalMergeSort() unit testkeyboard_arrow_up 0 / 1 Compilation failed Compilation failed ./GradingSorter.java:17: error: getSortedRunLength(int[],int,int) in GradingSorter cannot override getSortedRunLength(int[],int,int) in NaturalMergeSorter public int getSortedRunLength(int[] array, int arrayLength, int startIndex) { ^ overridden method is static ./GradingSorter.java:16: error: method does not override or implement a method from a supertype @Override ^ ./GradingSorter.java:30: error: merge(int[],int,int,int) in GradingSorter cannot override merge(int[],int,int,int) in NaturalMergeSorter public void merge(int[] array, int leftFirst, int leftLast, int rightLast) { ^ overridden method is static ./GradingSorter.java:29: error: method does not override or implement a method from a supertype @Override ^ ./GradingSorter.java:54: error: naturalMergeSort(int[],int) in GradingSorter cannot override
  • 6. naturalMergeSort(int[],int) in NaturalMergeSorter public void naturalMergeSort(int[] array, int arrayLength) { ^ overridden method is static ./GradingSorter.java:53: error: method does not override or implement a method from a supertype @Override ^ 6 errors 4:NaturalMergeSort() unit testkeyboard_arrow_up 0 / 1 Compilation failed Compilation failed ./GradingSorter.java:17: error: getSortedRunLength(int[],int,int) in GradingSorter cannot override getSortedRunLength(int[],int,int) in NaturalMergeSorter public int getSortedRunLength(int[] array, int arrayLength, int startIndex) { ^ overridden method is static ./GradingSorter.java:16: error: method does not override or implement a method from a supertype @Override ^ ./GradingSorter.java:30: error: merge(int[],int,int,int) in GradingSorter cannot override merge(int[],int,int,int) in NaturalMergeSorter public void merge(int[] array, int leftFirst, int leftLast, int rightLast) { ^ overridden method is static ./GradingSorter.java:29: error: method does not override or implement a method from a supertype @Override ^ ./GradingSorter.java:54: error: naturalMergeSort(int[],int) in GradingSorter cannot override naturalMergeSort(int[],int) in NaturalMergeSorter public void naturalMergeSort(int[] array, int arrayLength) { ^ overridden method is static ./GradingSorter.java:53: error: method does not override or implement a method from a supertype @Override ^ 6 errors 5:NaturalMergeSort() unit testkeyboard_arrow_up 0 / 5 Five more test cases Compilation failed Compilation failed ./GradingSorter.java:17: error: getSortedRunLength(int[],int,int) in GradingSorter cannot override getSortedRunLength(int[],int,int) in NaturalMergeSorter public int getSortedRunLength(int[] array, int arrayLength, int startIndex) { ^ overridden method is static ./GradingSorter.java:16: error: method does not override or implement a method from a supertype @Override ^ ./GradingSorter.java:30: error: merge(int[],int,int,int) in GradingSorter cannot override merge(int[],int,int,int) in NaturalMergeSorter public void merge(int[] array, int leftFirst, int leftLast, int rightLast) { ^ overridden method is static ./GradingSorter.java:29: error: method does not override or implement a method from a supertype @Override ^ ./GradingSorter.java:54: error: naturalMergeSort(int[],int) in GradingSorter cannot override naturalMergeSort(int[],int) in NaturalMergeSorter public void naturalMergeSort(int[] array, int arrayLength) { ^ overridden method is static ./GradingSorter.java:53: error: method does not override or implement a method from a supertype @Override ^ 6 errors