subject

The following two algorithms are designed to find the minimum value in a list of integers. Create a variable min, and set this to the first value in the list. Compare each
Algorithm subsequent value in the list against the value of min, and if it is smaller than
1: or equal to the current value, set min to this value. When the end of the list
is reached, display the value of min
Create a variable min , and set this to 0. Compare each value in the list
Algorithm
against the value of min, and if it is smaller than the current value, set min to
11:
this value. When the end of the list is reached, display the value of min.
Which of the following statements correctly demonstrates that the two algorithms are
NOT equivalent?
Neither algorithm will correctly display the minimum value of the list [0, 5, 6, 2]
Algorithm I will correctly display the minimum value of the list [4, 10, 6, 1],but Algorithm II
will not
Algorithm Il will correctly display the minimum value of the list (-4, 2, 3, 2) but Algorithm
will not
Both algorithms will correctly display the minimum value of the list [-1, 3, -4, 8]

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 19:50
Write a car class having two private member variables called tank and speed. write public methods called pumpgas and gofast. the method pumpgas gets an integer for gas that must be pumped. that value needs to be added to tank (no more than 20 gallons). it must return the amount of gas that is purchased ($4 per gallon). the method gofast should increase the speed by 5 each time it is called.write a constructor for the above class that initialized both variables to zero.write a tostring to display both the tank and speed when the car is printed.modify the car class to implement the interface comparable and an interface called carinter having the public methods in carinter.write the main program to create an array of size 5 of type car. create 5 car objects having each location of the array to refer to one of the cars. test the pumpgas, gofast, equals method on the array items. write an enhanced loop to print all the car values (using a tostring written last time).write a generic method to find the minimum of four items. pass int, double, char, string and car objects to test this method.
Answers: 1
question
Computers and Technology, 23.06.2019 13:10
What is domain name system (dns)? allows dynamic ip address allocation so users do not have to have a preconfigured ip address to use the network converts ip addresses into domains, or identifying labels that use a variety of recognizable naming conventions the efficient coexistence of telephone, video, and data communication within a single network, offering convenience and flexibility not possible with separate infrastructures the integration of communication channels into a single service
Answers: 2
question
Computers and Technology, 24.06.2019 12:50
What percentage of teens plays video games? a.97% b.100% c.74% d.50%
Answers: 1
question
Computers and Technology, 24.06.2019 14:30
Which computer network component connects two different networks together and allows them to communicate? a is a node (or a device) that connects two different networks together and allows them to communicate.
Answers: 1
You know the right answer?
The following two algorithms are designed to find the minimum value in a list of integers. Create...
Questions
question
Mathematics, 15.07.2020 17:01
question
Geography, 15.07.2020 17:01
question
Mathematics, 15.07.2020 17:01
Questions on the website: 13722361