COMP 302 Lecture Notes - Lecture 16: Tree Traversal, Type System, Eastern Partnership

35 views7 pages

Document Summary

It says in the assignment that we do not allow multiple terms with the same exponent. Furthermore, they are sorted in order of decreasing degree. We do not represent terms if the coefficient is 0. This does not happen except with int and float . Doing this does not make it into a polynomial. Do not cast things into the type polynomial. It takes a (float * int) list list and maps it to the type poly . We have used the list collection , which comes with built-in imperative iterators. We have seen list. map, which takes as input a function and a list, and outputs a list with the function applied to each item in the list. But we might want to execute imperative code associated with each element of the function (such as printing). If we want to iterate an imperative function on a list, use list. iter : List. iter (fun x -> printf %in x ) [15]

Get access

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