subject

Fill in the code to complete the following method for sorting a list.

public static void sort(double[] list) {
;
}

public static void sort(double[] list, int high) {
if (high > 1) {
// find the largest number and its index
int indexofmax = 0;
double max = list[0];
for (int i = 1; i < = high; i++) {
if (list[i]> max) {
max = list[i]; indexofmax = i;
}
}

// swap the largest with the last number in the list
list[indexofmax] = list[high];
list[high] = max;

// sort the remaining list
sort(list, high - 1);
}
}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 19:10
Select the correct answer. emma, the quality control manager in a software development company, asks the testing team to check whether the user interface is friendly. to which type of testing is emma referring? a. usability testing b. data comparison c. validation testing d. stress testing e. destruction testing
Answers: 1
question
Computers and Technology, 21.06.2019 19:30
Asalesman at a high end computer security firm want to sell you a proactive cover for your passport, which contains an rfid tag inside storing your sensitive information. the salesperson's solution cost only $79.99 and protects your passport from being read via radio waves while it is in your pocket. explain how you can achieve the same thing under $3.00
Answers: 3
question
Computers and Technology, 22.06.2019 10:40
When running anti-virus software , what could be a reason where recipitent is not guaranteed that data being streamed will not get interrupted?
Answers: 1
question
Computers and Technology, 22.06.2019 17:20
[a] create a class called “cycle” which has two instance integer variables as properties, “numberofwheels” and “weight.” create a constructor with two parameters, using the same variable names in the parameter list. assign each variable to numberofwheels” and “weight” respectively. write a separate application to test the class and display its properties. note: do not change the names of the instance variables or the variables listed in the constructor’s parameter list. [b] edit your class cycle by adding a default constructor which will assign the default values of 100 to represent the numberofwheels, and 1000 to represent the weight, by invoking a call to the other constructor. modify your application created in [a] to test the class.
Answers: 3
You know the right answer?
Fill in the code to complete the following method for sorting a list.

public static void...
Questions
question
History, 03.10.2019 01:30
Questions on the website: 13722360