I recently wrote this to compare the timings between recursive, iterative and cached approaches. I am finding that the recursive approach is the slowest in all my runs. Please comment if you find this is wrong or have any better approach to this.
https://gist.github.com/kmdarshan/6330926
Leave a Reply