recDist Counts all subproblems in order of frequency of times called and returns the frequency table as a dataframe.

recDist(result)

Arguments

result

resulting character vector from saveCalls

Value

dataframe containing recursive subproblems in sorted order by frequency

Details

Takes the result of saveCalls and gives a frequency table sorted by frequency of recursive subproblem.

Examples

fibResult <- saveCalls("output.txt") recDist(fibResult)
#> subProblems freq #> 3 fib(10) 1 #> 11 fib(9) 1 #> 10 fib(8) 2 #> 9 fib(7) 3 #> 8 fib(6) 5 #> 7 fib(5) 8 #> 6 fib(4) 13 #> 5 fib(3) 21 #> 1 fib(0) 34 #> 4 fib(2) 34 #> 2 fib(1) 55