next up previous contents
Next: Unstored Recursion Up: Performance Previous: Base 3 Counter

Stored Tree

The Stored Tree algorithm's runtime is bound by tex2html_wrap_inline352 . This comes from solving the recurrence relationship of the recursive algorithm as follows.

tex2html_wrap_inline354

Is the recurrence relationship of Stored Tree.

tex2html_wrap_inline356

Change of variable to n.

tex2html_wrap_inline360

tex2html_wrap_inline362

tex2html_wrap_inline364

tex2html_wrap_inline366

tex2html_wrap_inline368

tex2html_wrap_inline370

This shows that the running time is bound by tex2html_wrap_inline352 .

tabular142

Below is a plot of the above data I collected on the running time of Stored Tree. These test were done on waldrog using the systems time command and reading off the real output. Plotted with the data points is the curve of tex2html_wrap_inline380 with k set to 8.7E-6. The plot's y axis is on a logarithmic base 3 scale to show finer detail.

tex2html_wrap404

The curve of tex2html_wrap_inline174 does not match the data points very well, I believe is because of two things. When n is small (n<8) tex2html_wrap_inline174 does not account for startup time of the program, loading into memory operating systems calls, and ending time printing the data, and so on. When n is large (n>12) the tree takes a LOT of virtual memory space, virtual memory is slow and probably could account for the extra time on the running. Also the virtual memory plays another role in this algorithm, for n>13 the program can not be solved on waldrog because it runs out of virtual memory at about 150MB, any n greater than 13 in my tests made the virtual memory fail.



Jamie Marconi
Thu May 23 20:07:44 PDT 1996