Re: functional code
- To: mathgroup at smc.vnet.net
- Subject: [mg4814] Re: functional code
- From: rhall2 at umbc.edu (hall robert)
- Date: Fri, 20 Sep 1996 01:12:38 -0400
- Organization: University of Maryland, Baltimore County
- Sender: owner-wri-mathgroup at wolfram.com
Here's the times for the various solutions to Richard Gaylord's problem: In[90]:= original[row] Out[90]= {0.7 Second, Null} In[92]:= gaylord[row] Out[92]= {2.51667 Second, Null} In[94]:= hall[row] Out[94]= {3.63333 Second, Null} In[96]:= abbott1[row] Out[96]= {1.03333 Second, Null} In[98]:= abbott2[row] Out[98]= {1.13333 Second, Null} In[100]:= hayes[row] Out[100]= {0.116667 Second, Null} The most obvious algorithm, using iteration rather than recursion (original, hayes, and the 2 abbotts,) was the fastest. The most C-like code was the fastest (hayes.) My code was the least intuitive, probably the hardest to debug, and the slowest. Oh well.... "I can't hope to be First[], so let me be Last[]." -Auden, The Age of Anxiety -- Bob Hall | "Know thyself? Absurd direction! rhall2 at gl.umbc.edu | Bubbles bear no introspection." -Khushhal Khan Khatak ==== [MESSAGE SEPARATOR] ====