Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Since memory is becoming more & cheaper, the prominence of runtime complexity is enhancing. However, it is very much significant to analyses the amount of memory utilized by a program. If the running time of any algorithms is not good then this will take longer to execute. However, if this takes more memory (the space complexity is more) beyond the capacity of the machine then the program will not execute at all. Therefore it is more critical than run time complexity. However, the matter of respite is that memory is reutilized throughout the course of program execution.

We will analyses this for recursive & iterative programs.

For an iterative program, usually this is just a matter of looking at the variable declarations and storage allocation calls, for example number of variables, length of an array etc.

The analysis of recursive program w.r.t. space complexity is more complexes as the space utilized at any time is the total space used through all recursive calls active at that time.

Each of recursive call takes a constant amount of space & some space for local variables and function arguments, and for remembering also some space is allocated where each call must return to. General recursive calls employ linear space. That is, for n recursive calls, the space complexity is O(n).

Assume the following example: Binary Recursion (A binary-recursive routine (potentially) calls itself twice).

A.    If n equals 0 or 1, then return 1

B.     calculate recursively f (n-1)

C.     calculate recursively f (n-2)

D.    Return the total of the results from steps 2 and 3.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9534992

Have any Question?


Related Questions in Computer Engineering

Systems analysis project personal trainer inc owns and

Systems analysis project Personal Trainer, Inc. owns and operates fitness centers in a dozen Midwestern cities. The centers have done well, and the company is planning an international expansion by opening a new "superce ...

Question part 1 capstone exam - submit to the unit 2 ip

Question: Part 1: Capstone Exam - Submit to the Unit 2 IP Area This exam assignment may only be completed through the end of Unit 4. It will not be accepted late during Unit 5. This exam may only be completed on a comput ...

What are the uses and value of statistical significance

What are the uses and value of statistical significance testing and the p-value as demonstrated in the various analytical techniques (t-tests, ANOVA, chi-square, etc.). What's the fundamental reason we apply these techni ...

What are content management systems cms describe the

What are Content Management Systems (CMS). Describe the challenges in implementing and maintaining CMS. Can internet search engines be considered as Content Management Systems - explain your answer.

Question sales tax in new york city is 8875write a function

Question : Sales tax in New York City is 8.875%. Write a function float computeTax(float saleamount) that takes the price of a purchase as input, and prints to the screen the amount of the purchase, the sales tax owed, a ...

Structured programming is a subset of procedural

Structured programming is a subset of procedural programming. If structured programming promotes the creation of good code and procedural programs are easier to maintain, why do you need to shift to OOP? What are the pro ...

Please pick a health care phenomenaproblem and use philip

Please pick a health care phenomena/problem and use Philip Jacobs's descriptive, explanatory and evaluative model (in studying Economics) to analyze it. (Please use the real statistics that you search online and cite the ...

Describe the difference in economic profit between a

Describe the difference in economic profit between a competitive firm and a monopolist in both the short and long run. Which should take longer to reach the long-run equilibrium?

We might consider a regression of the number of group

We might consider a regression of the number of group members and the efficiency of project completion. Which of those would be the dependent and which would be the independent variables?

Sql transactions exercisesfor the universal relation rwxyz

SQL Transactions Exercises For the universal relation R(w,x,y,z), consider the decomposition D consisting of R1(w,y,z) and R2(x,y), and the set F of functional dependencies { y->xz ; yz->w ; x->w }. Recall that the proje ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As