Function mult
1.ans <- 0
2. For i=1 thru a by 1
a. Ans <- ans+b
3. Return (ans0
end mult
function raise
1.ans <-1
2.for i=1 thru b by 1
3.return (ans)
4.end raise
Chat with our AI personalities
Describe an algorithm for dividing rational numbers.
algorithm
The full Question...Suppose 3 algorithms are used to perform the same task for a certain number of cycles. Algorithm A completes 3 cycles in one minute. Each of Algorithm B and Algorithm C respectively completes 4 and 5 cycles per minute. What is the shortest time required for each Algorithm to complete the same number of cycles?
An algorithm is a systematic method used to solve some problem.An algorithm is a systematic method used to solve some problem.An algorithm is a systematic method used to solve some problem.An algorithm is a systematic method used to solve some problem.
You don't write an algorithm for a C++ program, unless you are documenting the C++ program after-the-fact. The normal procedure is to write the algorithm first, in a language independent fashion, and then translate that stated algorithm into C++ code, or into whatever language you wish.