Exam1F04 - Student Name: Design of Programming Languages -...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Student Name: Design of Programming Languages - Fall 2004 First Exam Oct. 19, 2004 Points: 1. 2. 3. 4. 5. 6. Do any 5. In the following two problems represent the tree Figure 1 : A test Binary Tree 1. (10 pts) DataTypes in ML. (4 pts) Define the recursive datatype btree . A tree should be Empty or should consist of a triple made up of a label and two b-subtrees (the left subtree and the right subtree). Use the tree above to construct a specific testTree using your datatype. val testTree = ... (6 pts) Write an ML function that takes a btree as its argument and returns its fringe, i.e. the list, left to right, of its leaves - where a leaf is a non-empty tree whose root has no subtrees. 1 2. (10 pts) DataTypes in Scheme. (4 pts) Define the recursive datatype btree (the meaning of this request should give you some pause). A tree should be empty or should consist of a triple made up of a label and two b-subtrees (the left subtree and the right subtree). Use the tree above to construct a specific...
View Full Document

This note was uploaded on 02/13/2012 for the course CS 91.531 taught by Professor Giam during the Fall '09 term at UMass Lowell.

Page1 / 2

Exam1F04 - Student Name: Design of Programming Languages -...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online