;; Find Pascal element
;; row = row number in the pascal triangle,
;; row >= 1
;; elt = elt'th element of the row,
;; 1 <= elt <= row
(define (pascal row elt)
(if (or (= elt 1) (= elt row)) 1
(+ (pascal (- row 1) (- elt 1))
(pascal (- row 1) elt))))
Saturday, May 30, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment