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 / 5018
5017  |  5019
Subject: 
Re: A recursion question/test... (correction)
Newsgroups: 
lugnet.robotics
Date: 
Wed, 12 May 1999 06:22:53 GMT
Original-From: 
Malcolm S Powell <MSP@UMBRAspamless.CO.UK>
Viewed: 
397 times
  
Whoops! I typed the last two lines with the two aggregate operators
interchanged! Obviously they should have read

FUNCTION sum(n: natural): natural = SUM [0..n]

FUNCTION fac(n: natural): natural = PRODUCT [1..n]


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



Message is in Reply To:
  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 (...) (25 years ago, 12-May-99, to lugnet.robotics)

7 Messages in This Thread:






Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

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