CS 291 University of Puget Sound Spring, 2020
 
Programming Language Paradigms:
Explorations with Functional Problem Solving (supported by Scheme/Haskell)
and Declarative Prblem Solving (supported by Prolog)
 

Supplemental Problems—Scheme

The following problem listing represents initial brainstorming and should not be considered final. Problems may be added, removed, and/or modified as the semester progresses.

  1. Write the following Scheme functions:

    1. (factorial n) that computes n factorial
    2. (comb n k) that computes the number of combinations of n items taken k at a time.
  2. Write a Scheme function numatons ls) that computes the number of atoms inthe list ls and its sublists. Thus,
    (numatoms '(A (B C) D (E (F G)) H)) returns 8, as each letter here is counted once.

created 30 November 2019
revised November-December 2019
Valid HTML 4.01! Valid CSS!
For more information, please contact Henry M. Walker at walker@cs.grinnell.edu.