MATH 114 Midterm: MATH 114 UPenn 114Fall 04Alt Exam

17 views12 pages
31 Jan 2019
School
Department
Course
Professor

Document Summary

42 b. let rec f (l : "a list) : ("a list * "a list) = begin match l with. | h::t -> h y :: f t y. | _ -> [] end let r : int list = f [(fun x -> - x); (fun x -> x * (x + 1))] 6. For each ocaml value or function de nition below, ll in the blank where the type annotation could go or write ill typed if there is a type error. If an expression can have multiple types, give the most generic one. Recall that the @ operator appends two lists together in ocaml. We have done the rst one for you. Grading scheme: 1 points per answer: 0 if wrong, 1 if right. 3: binary trees and binary search trees (16 points) Recall the de nition of generic binary trees and the bst insert function: type "a tree =

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers

Related textbook solutions

Related Documents

Related Questions