![subject](/tpl/images/cats/informatica.png)
Computers and Technology, 08.03.2021 20:10 look26goingjbgy
Consider the following correct implementation of the selection sort algorithm.
public static void selectionSort(int[] elements)
{
for (int j = 0; j < elements. length - 1; j++)
{
int minIndex = j;
for (int k = j + 1; k < elements. length; k++)
{
if (elements[k] < elements[minIndex])
{
minIndex = k;
}
}
if (j != minIndex)
{
int temp = elements[j];
elements[j] = elements[minIndex];
elements[minIndex] = temp; // line 19
}
}
}
The following declaration and method call appear in a method in the same class as selectionSort.
int[] arr = {30, 40, 10, 50, 20};
selectionSort(arr);
How many times is the statement elements[minIndex] = temp; in line 19 of the method executed as a result of the call to selectionSort ?
a. 1
b. 2
c. 3
d. 4
e. 5
![ansver](/tpl/images/cats/User.png)
Answers: 2
![](/tpl/images/ask_question.png)
![](/tpl/images/ask_question_mob.png)
Another question on Computers and Technology
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 21.06.2019 21:00
If you have a lien on your vehicle, you cannot apply for a duplicate copy of your vehicle’s certificate of title. true or false
Answers: 1
![question](/tpl/images/cats/informatica.png)
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 24.06.2019 00:20
The guy wire bd exerts on the telephone pole ac a force p directed along bd. knowing the p must have a 720-n component perpendicular to the pole ac, determine the magnitude of force p and its component along line ac.
Answers: 2
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 24.06.2019 08:00
Can someone work out the answer as it comes up in one of my computer science exams and i don't understand the cryptovariables
Answers: 1
You know the right answer?
Consider the following correct implementation of the selection sort algorithm.
public static void s...
Questions
![question](/tpl/images/cats/ekonomika.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 19.10.2019 08:10
![question](/tpl/images/cats/mat.png)
Mathematics, 19.10.2019 08:10
![question](/tpl/images/cats/mat.png)
Mathematics, 19.10.2019 08:10
![question](/tpl/images/cats/mat.png)
Mathematics, 19.10.2019 08:10
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/health.png)
Health, 19.10.2019 08:10
![question](/tpl/images/cats/en.png)
English, 19.10.2019 08:10
![question](/tpl/images/cats/mat.png)
Mathematics, 19.10.2019 08:10
![question](/tpl/images/cats/en.png)
English, 19.10.2019 08:10
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/health.png)
Health, 19.10.2019 08:10
![question](/tpl/images/cats/mat.png)
Mathematics, 19.10.2019 08:10
![question](/tpl/images/cats/himiya.png)
Chemistry, 19.10.2019 08:10
![question](/tpl/images/cats/biologiya.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/fizika.png)
Physics, 19.10.2019 08:10
![question](/tpl/images/cats/biologiya.png)