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
belka [17]
3 years ago
12

InExercise1youwereaskedtomodifytheSortsprogramsothatitwouldoutput thenumberofswapsusedbyasortingmethod.Itisalittlemoredificultto

havethe programalsooutputthenumberofcomparisons(compares)needed.Youmustinclude oneormorestatementstoincrementyourcounterwithinthesortingmethods themselves.Foreachofthelistedmethods,makeandtestthechangesneeded,and listboththenumberofswapsandthenumberofcomparesneededbytheSorts programtosortanarrayof50randomintegers. a. selectionSort swaps:____ compares:____ b. bubbleSort swaps:____ compares:____ c. shortBubble swaps:____ compares:____ d. insertionSort swaps:____ compares
Computers and Technology
1 answer:
mariarad [96]3 years ago
3 0

Answer:

D. InsertionSort swap: compares

Explanation:

The insertion sort swap is useful in making changes to the program needed to be sorted.

It should be noted that, this method is used to list the numbers of swap and the number of compares which are needed by the sort program.

You might be interested in
The Open Systems Interconnection (OSI) is a conceptual model whose purpose is to make networks more manageable. Its objectives i
andrew-mc [135]

Answer:

A. data-link layer

Explanation:

Data-link layer is the first layer and allows a contiguous sequence of bits to be transmitted through the network.

On top of it is the Network Layer and it handles the task of routing network messages from one computer to another.

Then comes the Transport Layer which is the basic layer at which one network computer communicates with another network computer.

6 0
3 years ago
In a paragraph discuss 5 steps of saving a document in a storage device.<br>​
zubka84 [21]
<h2>The five steps of saving a document in a storage device are firstly, click File. Secondly, click Save As.</h2><h2> In addition, click Computer. Moreover, double click the storage device and type file name. Lastly, click Save or Enter.</h2>
6 0
2 years ago
Which two editions of Windows 7 support 64 bit CPUs? Choose two out of Professional, Business, Starter, or Home Premium.
Tju [1.3M]
Home premium, professional
6 0
4 years ago
Write the definitions for three function named max. Each receives two parameters, of the same type, and returns the larger of th
GenaCL600 [577]

Answer:

The method definition to this question can be given as:

Method definition:

double max(double x, double y)  //define method with double parameter  

{

if (x>=y)    //check condition.

return x;  //return value

else

return y;     //return value

}

double max(int x, int y)    //define method with integer parameter

{

if (x>=y)    //check condition

return x;    //return value

else

return y;  //return value

}

double max(char x, char y)   //define method with char parameter

{

if (x>=y)    //check condition

return x;    //return value

else

return y;    //return value

}

Explanation:

The above method definition can be described as below:

  • In the first method definition first, we define a method that is "max()". In this method we pass two variables as a parameter that is "x and y" and the datatype of this is double. Then we use a conditional statement. In the if block we check if variable x is greater then equal to y then it will return x else it will return y.  
  • In the second method definition, we define a method that is same as the first method name but in this method, we pass two integer variable that is "x and y". Then we use a conditional statement. In the if block we check if variable x is greater then equal to y then it will return x else it will return y.
  • In the third method definition, we define a method that is same as the first and second method name but in this method, we pass two char variable that is "x and y". Then we use a conditional statement. In the if block we check if variable x is greater then equal to y then it will return x else it will return y.
8 0
3 years ago
What data type would you use for a decimal number?* ​
Elan Coil [88]

Answer:

numeric

Explanation:

The decimal data type is an exact numeric data type defined by its precision (total number of digits) and scale (number of digits to the right of the decimal point).

I hope this answers your question.

3 0
3 years ago
Other questions:
  • Describe three general methods for passing parameters to the operating system.
    6·1 answer
  • How can you keep your files organized on your computer?
    13·2 answers
  • What happens when a magnet is close to a iron nail?
    12·1 answer
  • How is the cia triad used to evaluate encryption methods?
    6·1 answer
  • What is the difference between head header and heading in HTML​
    8·1 answer
  • Which K-Drama was made in 2009?
    5·2 answers
  • Both aliases and functions can be used to store commands that can be executed, but functions can also accept positional paramete
    14·1 answer
  • What is the meaning of the term plot?<br>A. the final outcome of the story​
    8·1 answer
  • Write a program that generates 100 random numbers and keeps a count of how many of those random numbers are even and how many of
    15·1 answer
  • At a family reunion, your cousin takes a picture of both of you with her phone, orders a print of it, and mails it to you with a
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!