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]
2 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]2 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
All of the different devices on the internet have unique addresses.
Sindrei [870]

Answer:

Yes

Explanation:

Just like a human fingerprint, no 2 computers are the same.

3 0
3 years ago
A film producer is having difficulty with distribution. After major and minor theaters show no interest in the film, what would
irinina [24]

Answer:

pursue internet distribution

Explanation:

4 0
2 years ago
DDL statement for adding a column to an existing table is
vaieri [72.5K]

Answer:to add a column to existing table.

to rename any existing column.

to change datatype of any column or to modify its size.

to drop a column from the table.

Explanation:

hope this help

4 0
2 years ago
Fuel-pressure regulators on fuel-return-type fuel-injection systems are installed
Natalija [7]
1) The correct answer is <span>B. at the end of the fuel rail.
2) The one who is correct is the Technician A.</span>
5 0
3 years ago
Read 2 more answers
Mix ‘em Let s1 and s2 be 2 c-strings of the same length. Write a function char* mixem(char*s1, char* s2) which returns a c-strin
Shkiper50 [21]

Answer:

See Explaination

Explanation:

#include <iostream>

#include <string.h>

using namespace std;

char *mixem(char *s1, char *s2);

int main() {

cout << mixem("abc", "123") << endl;

cout << mixem("def", "456") << endl;

return 0;

}

char *mixem(char *s1, char *s2) {

char *result = new char[1 + strlen(s1) + strlen(s2)];

char *p1 = s1;

char *p2 = s2;

char *p = result;

while (*p1 || *p2) {

if (*p1) {

*p = *p1;

p1++;

p++;

}

if (*p2) {

*p = *p2;

p2++;

p++;

}

}

*p = '\0';

return result;

}

5 0
3 years ago
Other questions:
  • Which statements describe the advantages of using XML?
    12·2 answers
  • Write c program to check character is alphabate or not?​
    15·1 answer
  • You can use the_______key if your cursor is at the end of the word. Use the______key if you place the cursor on the left side of
    11·1 answer
  • Review the given requirements using the checklist and discover possible problems with them. The following requirements are for a
    8·1 answer
  • Which file extension indicates that a file is an Adobe Acrobat document?
    13·1 answer
  • Before creating a brief to design a product, what is needed
    8·1 answer
  • Write a class Example() such that it has a method that gives the difference between the size of strings when the '-' (subtractio
    6·1 answer
  • What do you do when you have computer problems? Check all that apply. PLEASE HELP
    9·2 answers
  • Identify five type of application software​
    12·2 answers
  • READ CAREFULLY! There is a difference between moving and copying files.a. Create a directory named . For example, mine would be
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!