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:
Below is the code ...hope it meet the requirements
lda 0, i
adda 6, i
suba 3, i
adda 2, i
STA 0x0010 ,d
CHARO 0x0010 ,d
.end
Explanation:
Answer:
87 66 55
Explanation:
Array is used o store the multiple values with same data type.
the array show a decimal value .66, i assume this is enter by mistake because option has no decimal value.
The index of the array is start from zero, it means the first element store in the array at position zero.
In the for loop the variable 'i' start from 1 not zero and it goes to i<4 means i=3.
So, it access the element from 2 to 4 because the index is position of element less than 1.
Therefore, 87 66 55 print.
Answer is Bit defender Internet security
B