1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
OleMash [197]
3 years ago
8

Brian has created the following selection sort class in Java. In which line is the index of the smallest value returned? In whic

h line is the input array given as an argument?
public class SelectionSort{
private static int positionMin (int] vals, int startPosition) {
int minPosition startPosition;
for (int i startPosition; i
if (vals[i] vals[min Position]) {

minPosition = i;
return min

Position; private static void swap(int] vals, int firstPosition, int secondPosition) {

int temp; temp vals[firstPosition];
vals[firstPosition] vals[second Position];
vals[secondPosition] temp return public static void selSort(int| vals) {
int minPos for (int startPos 0; startPos< vals.length; startPos++){

minPos positionMin(vals,startPos); swap(vals,startPos, min Pos) ;

for (int i 0; i< vals.length; i++) { if(i
}else Jelse { System.out.println(vals[i]); } }; }

return; } }
Computers and Technology
1 answer:
katen-ka-za [31]3 years ago
8 0

Answer:

Explanation:

Since there are no line numbers in this question I will start counting from public class SelectionSort{ as line 1 and so on, as well as provide the code on that line.

The index of the smallest value is returned on line 8 where it says return min which shouldn't have any spaces and should be return minPosition;

The input array is given as an argument at the beginning of the function on line 2 where it says private static int positionMin (int] vals, int startPosition) {, as the variable vals.

This input array is also used as an argument on line 10 where it says Position; private static void swap(int] vals, int firstPosition, int secondPosition) and line 15 where it says vals[secondPosition] temp return public static void selSort(int| vals) {

You might be interested in
Create an Entity-Relationship Diagram with the following requirements.
melamori03 [73]

Answer:

idk

Explanation:

6 0
3 years ago
When entering a function or formula in a cell, which is the first character
AnnZ [28]

Answer:

B

Explanation:

6 0
2 years ago
If you created a variable called name, what data type would that value be? Group of answer choices a float a string a Boolean an
Semenov [28]

I think its an integer

8 0
3 years ago
Read 2 more answers
How does coding work on computers?
sleet_krkn [62]
Coding works through programming/programs. Programs have different coding languages, and text files. The code within the file is known as the "source CODE" this code is used in different ways, causing for the possibility of separate binary files that computers can directly run. Hope I helped.

5 0
3 years ago
Differentiate between Scope and Linkage
Lera25 [3.4K]

Answer: The difference between the scope and linkage is as follows:-

  • Scope of the variable is defined as the variable view from different program parts whereas the linkage is described as the link that is made between the variable and the declaration function having the common name.
  • Scope of variable describes about the existing time of the variable in the program whereas linkage is defined for the name of variable present in the program is available at all time .

6 0
3 years ago
Other questions:
  • You should use _____ software for writing a letter.
    10·1 answer
  • As the driver it is not your responsibility that you are focused on the driving task with any possible distractions minimized. T
    9·2 answers
  • Which of the following is a true statement? Question 33 options: Data entities correspond to sources/sinks on a data flow diagra
    14·1 answer
  • Software that helps run the computer's hardware devices and coordinates instructions between applications is called
    10·1 answer
  • While a hard drive is running, even a slight bump against the computer may cause the
    9·2 answers
  • Application partitioning gives developers the opportunity to write application code that can later be placed on either a client
    7·1 answer
  • The program is to be answered in Java Programming not C++ Please answer the following: Modify the BarChart program to accept the
    6·1 answer
  • ____ is the most widely used language for writing system software because it combines the power of a high-level language with th
    12·1 answer
  • The construction of a mixed media assemblage would be considered
    9·1 answer
  • How are computers classified into different types? Explain ​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!