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
katovenus [111]
2 years ago
6

Describe an algorithm for finding the smallest integer in a finite sequence of natural numbers.

Mathematics
2 answers:
Crazy boy [7]2 years ago
5 0

Answer:

min = a_1

for i:= 2 to n:

      if a_i < min then min = a_i

return min

Step-by-step explanation:

We call the algorithm "minimum" and a list of natural numbers a_1, a_2, \cdot\cdot\cdot, a_n.

So lets first set the minimum to a_1

min = a_1

now we want to check all the other numbers.

We can use a simple for loop, to find the minimum

min = a_1

for i:= 2 to n:

      if a_i < min then min = a_i

return min

Aliun [14]2 years ago
3 0

Answer:

The sequence of natural numbers is a_1, a_2, a_3, ..., a_n.

Use min as the variable that will contain the minimum value.

Set min = a_1

In a loop, compare min to each number from a_2 to an.

If min > a_i, then let min = a_i

min = a_1

for i = 2 to n

  if min > a_i, then min = a_i

You might be interested in
Option D) 56.5<br> Please he I need to pass this unit test
galina1969 [7]
The formula is s = r * angle
Angle must be in RADIANS for the formula. Since the picture gives 135 degrees you either convert in the formula by adding the conversion factor, (s = r * angle * pi/180) or knowing that 135 degrees is 3pi/4.
s = 6 * 3* 3.14/4
s = 14.1
4 0
3 years ago
Choose all the equations for which x=3 is a solution
gregori [183]

A and D

A= 3+1=4

D=4*3=12

8 0
3 years ago
Read 2 more answers
Jim wishes to buy 3 gifts that cost 15 dollars, 9 dollars, and 12 dollars. he has 1/4 of the money he needs, how much more money
Archy [21]
In order to solve this, you have to plug in all of the costs of the gifts and add them, which in all equals $36. since jim only has 1/4 of the money he needs to buy the gifts, you need to divide 36 by 4. this gives you 9, so now you know he has 9 dollars.
and to find out how much more money he needs, you can subtract 9 from 36 which represents a fourth of the required money. the answer is 27, that's how much jim needs in order to buy his gifts.
7 0
4 years ago
What is cos 30? A b or c
Rzqust [24]
(Sqr.3)/2 not a or b or c
8 0
3 years ago
Show that 155 can be express as the sum of a power of 2 and a cube number? ​
son4ous [18]

\bf \underset{155-128}{155-2^7}= 27\qquad \qquad therefore\qquad 2^7+27=155\implies 2^7+3^3=155

3 0
4 years ago
Other questions:
  • Applicants for temporary office work at Carter Temporary Help Agency who have successfully completed an administrative assistant
    5·1 answer
  • What is the answer for t?
    12·1 answer
  • Help me with this problem and show work please
    13·1 answer
  • What angle is co-terminal with 125 Degrees
    12·1 answer
  • What is the equation of a line with a y-intercept at (0, 2) and a slope of 3?
    11·2 answers
  • You have 4 pounds of peanuts. You want to put it in the bags so that there is 2/3 pounds in each bag. How many bags can you fill
    10·1 answer
  • Can anyone help me please ​
    8·2 answers
  • A cleaning solution uses 5 cups of soap for every 2 cups of vinegar. If Emery put 4 cups of soap in a container, how
    9·1 answer
  • Question 2
    10·1 answer
  • A free kick is given in a soccer game where the player taking the kick is 14 yards from the left post. The goalie is standing on
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!