Tuesday
May 21, 2013

Homework Help: Discrete Mathematics

Posted by Compstudent on Wednesday, March 30, 2011 at 10:10pm.

How many elementary operations are used in the following algorithm?

Step 1 Set S = a, k = 0 , and t = a
Step 2 while k < n
(a) Replace t with t+d
(b) Replace S with S+t
(c) Replace k with k+1

endwhile
Step 2 Print S

------------------------
My answer was: 4*n+1
I don't know if it is right :(

Answer this Question

First Name:
School Subject:
Answer:

Related Questions

Elementary Mathematics - How can a teacher help a student develop a strong ...
polynomials - What is the basic principle that can be used to simplify a ...
Discrete Math - Pattern Matching 6. Build the Boyer-Moore last table for the ...
Elementary Mathematics - Thanks for your response Ms Sue.... but what does the ...
Elementary Math - The temperature of a cup of coffee is a discrete or continuous...
AED - Post your response to the following: The introduction of calculators and ...
intro programming - (algorithm workbench) Write assignment statements that ...
Math - Use multiplication, division, addition and subtraction and at least one ...
Discrete Math - Geometric Vectors - I'm lost! How do you add the following ...
discrete mathematics with applications - A logical equivalance is derived from ...

For Further Reading

Search
Members
Community