Please help with 3.15. Thank you The principal argument in favor of dynamic scop
ID: 3922922 • Letter: P
Question
Please help with 3.15. Thank you
Explanation / Answer
1) First way would be using a stack, whenever a function is called and it requires some other base, new base can be pushed on top of stack and that value can be used. and when the function completes execution it can be removed from top. It always gives the topmost element of stack as the current base so access time is decresed compared to dynamic scoping.
2) One other way would be passing the current base as argument which will increse memory usage a little but all over the performance will increse as less time will be required for searching.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.