To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 5004
5003  |  5005
Subject: 
Re: A recursion question/test...
Newsgroups: 
lugnet.robotics
Date: 
Wed, 12 May 1999 03:51:21 GMT
Original-From: 
Rich Clemens <(clemens@wvwc.)spamcake(edu)>
Viewed: 
851 times
  
(define (sum num)
  (if (zero? num)
      0
      (+ num(sum (- num 1)))))

--
Richard Clemens
Associate Professor
Computer Science Department
West Virginia Wesleyan College
Buckhannon, West Virginia  26201
clemens@wvwc.edu
304.473.8421


----- Original Message -----
From: Jim Choate <ravage@ssz.com>
To: <lego-robotics@crynwr.com>
Sent: Tuesday, May 11, 1999 9:19 PM
Subject: A recursion question/test...



Hi,

With all the discussion on understanding recursion and such for • programmers
I thought I'd share a little problem I find enlightening....


Describe as simple a recursive algorithm as possible for summing the first • n
numbers.


    ____________________________________________________________________

       Three step plan: 1. Take over world. 2. Get lot's of cookies.
                        3. Eat the cookies.

                                                    Anonymous

       The Armadillo Group       ,::////;::-.          James Choate
       Austin, Tx               /:'///// ``::>/|/      ravage@ssz.com
       www.ssz.com            .',  ||||    `/( e\      512-451-7087
                           -====~~mm-'`-```-mm --'-
    --------------------------------------------------------------------
--
Did you check the web site first?: http://www.crynwr.com/lego-robotics

--
Did you check the web site first?: http://www.crynwr.com/lego-robotics



1 Message in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    
Active threads in Robotics

 
Verified and Trusted Team of Hackers
19 hours ago
Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR