Question

Hello, i am not sure on how to work this out, can you explain and show how you get the answer? Cheers

The lecture notes show the top 5 levels of the call graph for a call coins_reqd(30, 11, 10, 25]) with a purely recursive impl

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Detailed explanation of how to do such problems is as follows:

Trace This problem using a stack: call to coins_read(11, [1,5,10]) is made, Create a stack and put all neccesary information

TWITTER follow same procedure till we reach node 5. The time we reach node 5, our stack will look like as follows: (10) T110)

au fob poop in this direction, 5,10] - Assume all falls. travessed as shown above, I now, just pop 15% off one more call for

stack is empty now, we have paversed our complete free, In whole baversal, we get Node is 3 times. Hence, It is called 3 time

Conclusion: Node "5" (yellow node) is called 3 times in this procedure.

Given only tree this was the most visualized way to solve this problems, it we would have given the recursion, then there are other ways to solve such kind of problems.

But this is the best way if you want to visualize things.

I have drawn stack horizontally, just to save space, don't confuse it with the queue. It's a stack.

Pardon my handwriting, i would have typed this answer if possible, but i needed to draw these stack instances.

If you still got any doubt in the explanation, lemme know in the comment section.

Add a comment
Know the answer?
Add Answer to:
Hello, i am not sure on how to work this out, can you explain and show...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Hello! Can somebody please show me the step-by-step for the reaction? I am getting B. as...

    Hello! Can somebody please show me the step-by-step for the reaction? I am getting B. as the answer but I am not sure if I am correct or not. Please explain, thank you! Preview File Edit View Go Tools Window Help く9凇令동삐:) 9696 CD Tue 4:10 PM OE 2211 Lecture 5A Aldehydes Ketones Fall 17 Student.pdf (page 29 of 69) Search ▼ 2211 Lecture 5A Aldehydes K 2 CH2CH2OH 312 27 H3C 3 a. 2,2-Diethoxypropane b. 2-Ethoxy-2-propandol c. Propane-2,2-diol 24

  • Hello, I am providing the answers for this assignment but can you do it and show...

    Hello, I am providing the answers for this assignment but can you do it and show the work. I also had a questions, I am not sure when the answers will be 0, so how am i able to tell when the current and voltage will be 0 and when they will not. Is there an easy way to tell this? The circuit shown below has a triangle wave voltage source with Vpeak-10 V, Vminimum10 Vand period T-3 mS series...

  • Hello! I am struggling on how to make 2 resonance forms for C3H5O-. Can you help...

    Hello! I am struggling on how to make 2 resonance forms for C3H5O-. Can you help me understand? Thank you!

  • Hello, I am having trouble figuring out how to go about each of these questions for...

    Hello, I am having trouble figuring out how to go about each of these questions for a worksheet as I have not learned any of this in orgo lecture yet but, I was given this assignment in orgo lab. Could someone please be kind enough to answer and give me an explanation for each one as I have no clue how to go about this. thank you for your time. at are the starting materials needed to run the size...

  • Hello, can you please help me understand question “g”. I am not sure how Rite Aid’s...

    Hello, can you please help me understand question “g”. I am not sure how Rite Aid’s balance sheet would be affected if the notes were to convert, and why do firms issue these types of notes, and why are investors interested in buying them? 8. Consider the 4.75% Convertible notes. How would Rite Aid's balance sheet be affected if these notes were converted? Why do firms issue convertible notes? Why do investors buy such notes? h Daf - 10. Indebtedness...

  • please show and explain all work. i am not understanding how to do this. Find the...

    please show and explain all work. i am not understanding how to do this. Find the equation of the tangent line to the graph of f(x) at the given point. f(x) = V12x + 24 at (1,6) Show all your work on the paper and submit it on Canvas. The equation of the tangent'line to the graph of f(x) at the given point is

  • Hello, I am requesting help with the following question. Can you please show the work on...

    Hello, I am requesting help with the following question. Can you please show the work on how to derive at the correct answer? Thank you Proposal #1 would extend trade credit to some customers that previously have been denied credit because they were considered poor risks.   Sales are projected to increase by $200,000 per year if credit is extended to these new customers. Of the new accounts receivable generated, 6% are projected to be uncollectible. Additional collection costs are projected...

  • Hello, Please help me with my Lab work problems I am having trouble. Please show all...

    Hello, Please help me with my Lab work problems I am having trouble. Please show all Work! How would you make a 200 mL solution of 0.5 M NaCl? How would you make a 250 mL of 8% sucrose solution from a 20% sucrose solution? How would you make a 150 mL solution of 5M NaCl from a 8M NaCl? How would you make a 500 mL solution of 10 mM NaCl and 0.2M NaOH? If given a vial of...

  • Can someone help me out with part b? I am not sure what I am doing...

    Can someone help me out with part b? I am not sure what I am doing wrong. the first answer I got was 22 degrees and that wasn't right either. Thank you for your help. 2 2/4 points Previous Answers My Notes Ask Your Teacher - 70.00 kgs at another corner, and a my 115.00 kg mass the third comer Find the magnitude and An equilateral triangle 10 mon a side has am 30.00 kg mass at one corner, am...

  • Hello, I am asked to determine whether there is 1, 2, or no triangles. I am not sure on how I am supposed to do this. I started by using the law of sines and show the steps on my paper. Please correc...

    Hello, I am asked to determine whether there is 1, 2, or no triangles. I am not sure on how I am supposed to do this. I started by using the law of sines and show the steps on my paper. Please correct me if I am wrong. If I am going in the right direction please tell me what else I need to do. Please provide steps if possible thanks! Ignore the pink highlighted numbers 0cmie whehs or nu...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT