Sequence Puzzles
The following functions ask you to become familiar with Seq.tabulate, Seq.length, and
Seq.nth. Add your functions to lab11.sml.
Transpose
Recall the function transpose from Homework 5:
transpose [1,2,3],
[4,5,6]
=>
[1,4],
[2,5],
[3,6]
Tas
Binary Search
At this point, it behooves us to introduce another of Sl'lL's huiltin datatypes: order. order
is a very simple datatypeit has preciser three values: GREATER. EQUAL. and LESS. and is
dened as follows:
datatype order = GREATER | EQUAL | LESS
Recursion on the Natural Numbers
is will write seyeraJ recursive functions over the natural numbers.
Basic Recursion
The bodies oF the rst two of these functions will Follow the basic pattern oF recursion that
we discussed in lecture. To review: They w