Last modified: 2017-11-03
This is a course web page of
David Casperson
Associate Professor
Computer Science
University of Northern British Columbia

CPSC 370: Functional and Logic Programming ( )

Homework now due

Questions 1–11 have been assigned due dates.

Pending homework questions

  1. Write a tail-recursive Scheme function (exists predicate a-list) that returns #true if and only if there is an element of a-list that satisfies predicate.

    For instance, (exists zero? '(1 2 3)) is #false.

  2. Write a Haskell tail-recursive function that counts the number of leaves in a

    data Tree a = Leaf a | Branch (Tree a) (Tree a)

    tree by using continuations.

    Repeat using another strategy to make the function tail-recursive.

  3. Write a Haskell tail-recursive function that makes an in-order list of the leaf values in a

    data Tree a = Leaf a | Branch (Tree a) (Tree a)

    tree by using continuations.

    Repeat using another strategy to make the function tail-recursive.

Home page Semesters Site Map
go back Fall 2017 go forward
2017-11 other links

CPSC 370 [Other years]
References
Homework
Dates
Policies
Resources
David’s Schedule

UNBC Undergraduate Calendar