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
MinMax is a function that takes five arguments and returns no value. The first three arguments are of type int. The last two arg
Luba_88 [7]

Answer:

#include <iostream>

using namespace std;

void MinMax(int x,int y,int z,int *max,int *min)

{

   int big,small;

   if((x>y)&&(x>z))    //to check for maximum value

       big=x;

   else if((y>x)&&(y>z))

       big=y;

   else

       big=z;

   if((x<y)&&(x<z))  //to check for minimum value

       small=x;

   else if((y<x)&&(y<z))

       small=y;

   else

       small=z;

   *max=big;   //pointer pointing to maximum value

   *min=small;     //pointer pointing to minimum value

}

int main()

{

   int big,small;

   MinMax(43,29,100,&big,&small);    

   cout<<"Max is "<<big<<"\nMin is "<<small;  //big and small variables will get value from method called

   return 0;

}

OUTPUT :

Max is 100

Min is 29

Explanation:

When the method is called from first three integers maximum will be found using the conditions imposed and maximum value will be found and similarly will happen with the minimum value.

5 0
3 years ago
20<br>Calculate the kinette energy of a body the speed<br>that will be a mass tragm​
jolli1 [7]

Answer:

20

Explanation:

4 0
3 years ago
Which statement will read an entire line of input into the following string object?
Solnce55 [7]

Answer:

getline(cin, address);

Explanation:

Given

String object: address

Required

Statement that reads the entire line

The list of given options shows that the programming language is c++.

Analysing each option (a) to (e):

a. cin<<address;

The above instruction will read the string object until the first blank space.

Take for instance:

The user supplied "Lagos state" as input, only "Lagos" will be saved in address using this option.

b. cin address:

This is an incorrect syntax

c. getline(cin,address);

Using the same instance as (a) above, this reads the complete line and "Lagos state" will be saved in variable address

d. cin.get(address);

address is created as a string object and the above instruction will only work for character pointers (i.e. char*)

<em>From the above analysis, option (c) is correct.</em>

6 0
3 years ago
You are planning to use Spark to create a machine learning model that recommends restaurants to users based on user details and
SCORPION-xisa [38]

Answer:

The third point i.e " Use an alternating least squares (ALS) algorithm to create a collaborative filtering solution" is the correct answer .

Explanation:

The Alternating Less Squares  is the different approach that main objective to enhancing the loss function.The Alternating Less Squares process divided the matrix into the two factors for optimizing the loss .The divided of two factor matrix is known as item matrix or the user matrix.

  • As we have to build the machine learning model which proposes restaurants to restaurants that are based on the customer information and the prior restaurant reviews the alternating least squares is the best model to implement this .
  • All the other options are not the correct model also they are not related to given scenario that's why they are incorrect options.
4 0
3 years ago
Applications require you to provide the following basic elements : name, contact information, and availability. True or False
iren2701 [21]

True

Companies will not hire unless they know your name, availability, email, phone number, and any other legal personal information that they need to know

6 0
3 years ago
Other questions:
  • Sarah is working on a project in which she needs to record all the extracurricular activities in her college. Her college teache
    13·2 answers
  • could someone plz enplane to me what iOS r because i go to donlaod a app on my phone and it says i need to upgrade to a iOS 8.0
    14·2 answers
  • in Google, how should you phrase your search if you want to exclude a certain word from your results(for example,"chocolate")?
    14·1 answer
  • Which feature of a blog marks a unique link to each post through which it can be recalled anytime?
    8·2 answers
  • Will there be a season 3 of Gravity Falls?
    5·2 answers
  • Rebecca completed work on a computer and is verifying the functionality of the system when she finds a new problem. This problem
    14·1 answer
  • Write the simulate method, which simulates the frog attempting to hop in a straight line to a goal from the frog's starting posi
    10·1 answer
  • Before creating a graphic, you should _____. Select all that apply. A. export it as an SVG file B. consider whe
    12·1 answer
  • Who is your favorite XC2 character, and why?
    15·1 answer
  • What is the password based off of the clues
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!