Solution to 9.7, Cracking the Coding Interview
1 Answer
Solution to 9.7, Cracking the Coding Interview
| Flag | PURGE
In the solution to exercise 9.7, there's a comment in the solution that "we have potentially 1 million functions on the call stack after going just 10 pixels away." Why is this, and how does this "work?" I understand there's a branching factor of 4, and 4^10 is ~1 million, but as far as I know we only add to the call stack one function at a time.... so why would the branching factor be an issue?
- foxjas09 January 03, 2015Email me when people comment.
Email me when people comment.
Loading...
An error occurred in subscribing you.
Email me when people comment.
Email me when people comment.
Loading...
An error occurred in subscribing you.
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
You're correct. The book is referring to the total number of function calls that will be evaluated, not to how many are on the stack at any given time.
- Anonymous January 06, 2015