Mathematics Homework Solutions
Problem
#32324

Analyzing an Algorithm

For the following algorithm find the number of times the assignment statement (:=) is executed during the running of the program. Answer the question by giving a formula in terms of n:

i := 1;
while i < n + 1 do
  i := i + 2;
  for j := 1 to i do S od
od




Solution Summary

An Algorithm is analyzed. The response received a rating of "5" from the student who posted the question.

Solution
What is this?
By OTA - Overall OTA Rating
Departed OTA
Purchase Cost Now
$2.19 CAD (was ~$3.99)
Included in Download
  • Plain text response
  • Attached file(s):
    • Solution.doc
$2.19 Instant Download
Add to Cart
Why you can trust BrainMass.com
  • Your Information is Secure
  • Best Online Academic Help Service
  • Students find real academic Success
Related Solutions
  • Analyzing an Algorithm - For the following algorithm find the number of times the addition operation (+) is executed during the running of the program. Answer the question by giving a formula in terms of n: for i := 1 to n ...
  • Algorithm to convert to binary - The problem is from Numerical Methods. Please show each step of your solution and tell me the theorems, definitions, etc. if you use any. 3. The following algorithm... Please see attached.
  • Discrete Mathematics and its Applications - 14. a) What is a recursive algorithm? b) Describe a recursive algorithm for computing the sum of n numbers in a sequence.
  • optimization algorithm - this is reserve for a Specific OTA you can solve the problem using genetic algorithm(GA),but do you think you can get near the solution in the the "Result_2_Xugang" PDF file i sent.please describe ...
  • Need Mat lab program for Bisection Algorithm - I need BISECTION ALGORITHM written in MATLAB. Could you please send the MATLAB program as soon as possible.
Browse