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
List the three control problems associated with competingprocesses and briefly define each.
hjlf

Answer and explanation :

the three control problems associated with competing process are

  • MUTUAL EXCLUSION : We know that some resources are shareable and some are not shareable. which means only one process can access the resource at a time this type of resources are called critical resources this code can be access at only one process at a time. the other process if required to access should not be allowed
  • DEADLOCK: this hold the process without complete for example suppose there are two resources R1 and R2 and two process P1 and P2 and P1 use R1 and P2 use R2 but after some time when P1 needs R2 but R2 is not available as it is used by P2 so the all process will be on hold
  • STARVATION : when priorities are given to the process as high priorities and low priorities. And high priorities process always competing  then low priorities process have to wait for very long time this is called starvation
3 0
2 years ago
In a game with three frames, where will the objects on Layer 1 appear?
Ivan
It’s between d or c
6 0
3 years ago
Read 2 more answers
If the contents of encrypted file1.nc and encrypted file3.nc are different, but the original file1 and file3 are the same, and y
Over [174]

Answer:

The Difference is because of the salt added to the password before hashing or encrypting it.

Explanation:

The Difference is because of the salt added to the password before hashing or encrypting it.

Salts are random data used to mention uniqueness. Suppose if two users have same password for the same system. By adding Salt to the password makes it unique in the crypto system. Its a added security layer which can safeguard the passwords or hashed data in the keystore or storage.

Salt can be prepended to the password or appended to the password.

Suppose the password is “stuti” then its SHA256 HASH value is <u><em>“4beb1eb6f438495eede7b14ac0d2b955636a49412cd4eb5714341f5716144954”</em></u>

So, if we add a salt with random string <em>brainlysalttest</em> then its SHA256 HASH value is <u><em>“5429e85778f1b9f493da637848f253dedf3edbfbb72782d43eb7337cee45ab0c”</em></u>

If we append the salt <em>brainlytestsalt</em> to the same password and hash it using SHA256 then its hash value is : <u><em>“3919b677d80ae0da2b58f70b464f6492670ccffee78cf52972c6983995ed8f52”</em></u>

So clearly Salting to the password and Hashing the salted password will make the difference and also unique.

3 0
3 years ago
Acróstico sobre mouse
Arlecino [84]

<h2>this is a PICTURE </h2>

<h3>i HOPE IT'S HELP </h3>

6 0
3 years ago
What is the value of ans after the following code has been executed? int x = 35; int y = 20, ans = 80; if (x &lt; y); ans = y; g
Sauron [17]

100

After the following code has been executed, the value of ans is 100:

int x = 35;

int y = 20;

ans = 80;

if (x < y) {

 ans += y;

}

This is because the value of ans is incremented by y when the code is executed.

Learn more here:

brainly.com/question/27093439

#SPJ4

8 0
1 year ago
Other questions:
  • To create a formula in ___ you would first click in one of the cells. A.word b.excel c.facebook d.powerpoint
    13·1 answer
  • On the first line, place your name in a comment. Create a program that does the following: Take in three integer numbers from th
    5·1 answer
  • List of steps to apply bold and italic formatting to a word​
    9·2 answers
  • _____ refers to the busiest calling hour of the day, week, month or year. And _____ refers to the average length of time the sub
    14·1 answer
  • Which statement is true of Web-based social media?
    12·1 answer
  • How can the use of new technology in industry benefit the us government
    8·2 answers
  • DO NOT ANSWER FOR JUST POINTS
    8·2 answers
  • How many of yall are willing to subscribe to my channel called "Space Juice" with around 245 subs?!​
    8·1 answer
  • Write a Boolean expression that tests if the value stored in the variable num1 is equal to the value stored in the variable num2
    10·1 answer
  • Implement one array of the English alphabet (26 characters). a) Create a function, getLetters() to cast and generate the array.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!