Answer:
Following are the algorithm to this question:
y = 0 // initialize variable y that assigns the value 0
p = 1 // initialize value 1 in the variable p which also known as starting position
init num = 1//define variable num that assign value 1
for j = 1 to n: //defining loop
y = m[j] - m[p]
if (y > 10) //defining if block
num++; //increment num variable
p=i; //holding loop value in p variable
y= 0//assign value 0 in y variable
Explanation:
Following are the runtime analysis of the above-given algorithm:
The above-provided algorithm is greedy, but if it doesn't exceed the scope, it operates by greedily choosing its next object. Therefore the algorithm selects the fewest number of pens.
Running time:
This algorithm merely iterates once over all the points. The run-time is therefore O(n).
Answer:
The output of the code is 8
Answer:
Im not certain but I think thwir is one called flip
Explanation:
Kind of works like a book if thats what your asking for
B. Summer monsoons bring heavy rainfall and winter monsoons create dry and arid conditions.
Answer:
a good algorithm must be able to accept a set of defined input. Output: a good algorithm should be able to produce results as output, preferably solutions. Finiteness: the algorithm should have a stop after a certain number of instructions. Generality: the algorithm must apply to a set of defined inputs.Explanation: