#note#Cracking the coding interview

Big O analysis of recursion: 

 

Try to remember this pattern. When you have a recursive function that makes multiple calls, the runtime will often (but not always) look like O(branche's depth), where branches is the number of times each recursivecall branches. In this case, this gives us O(2N). 

你可能感兴趣的:(面试准备)