omplete the following method that implements the Selection Sort Algorithm in arranging the elements of an array of objects of a Student class such that the string representations of the objects of Student follow lexicographic ordering. The method creates a copy of a given array of objects of Student, the method arranges the elements of the array by using the Selection Sort Algorithm and the method returns the sorted array. Assume that the copyArray method is accessible by the sortArray method and that the usage of the copyArray method in the sortArray method is correct. In addition, assume that the Student class has a default constructor. a. int x = 0; x < sorted.length - 1; x++ b. int x = 0; x < sorted.length; x++ c. int x = 0; x > sorted.length - 1; x++ d. int x = 0; x > sorted.length; x++ e. Not given
Complete the following method that implements the Selection Sort
a. int x = 0; x < sorted.length - 1; x++
b. int x = 0; x < sorted.length; x++
c. int x = 0; x > sorted.length - 1; x++
d. int x = 0; x > sorted.length; x++
e. Not given
![public Student [] sortArray (Student[] given) {
int minIndex = 0;
Studentt[] sorted = copyArray (given);
Student temp = new Student ();
for (
_) {
minIndex = x;
for (int y = x + 1; y < sorted.length; y++) {
if (sorted
[minIndex].toString().compareTo (sorted [y].toString()) > 0)
minIndex = y;
}
if (minIndex != x) {
temp = sorted [x];
sorted [x] = sorted [minIndex];
sorted [minIndex] = temp;
}
}
return sorted;
}](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F45fe4c57-b0e6-4485-95b7-0010badb1350%2F3022da2e-a7ba-46a2-a961-7777c19dd9ac%2Fhe1njyl_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)