A | |
| all_pairs [Warmup] | all_pairs xs should return the set-theoretic product of the list xs with
itself.
|
B | |
| binary_addition [Binary] |
The
binary_addition m n function is used to add two numbers m
and n represented in binary using bits.
|
| bits_to_int [Binary] | bits_to_int lst converts bits lst to an int.
|
C | |
| confirm_outputs [Lists] | confirm_outputs i o fs outputs true if and only if each
function f in fs returns output o when applies to
input i.
|
D | |
| drop_leading_zeros [Binary] | drop_leading_zeros lst returns lst' for
lst = Zero::...::Zero::lst', where Zero::...::Zero represents
all of the leading zeros in lst.
|
E | |
| eval [Arithmetic] |
The
eval function takes an input expression and evaluates it according
the rules of ordinary integer arithmetic.
|
| exp_fold [Arithmetic] |
The expression
fold val_op plus_op times_op exp recursively
processes each sub-expression of exp via the following scheme:
It applies the operation val_op to each Val sub-expression., It applies the operation plus_op to each Plus sub-expression., It applies the operation times_op to each Times sub-expression
|
F | |
| find_first_value_fold [Lists] | find_first_value_fold is identical to find_first_value_rec, but
uses a folding function from the List module instead of recursion.
|
| find_first_value_lib [Lists] | find_first_value_lib is identical to find_first_value_fold, but
uses functions other than those in the folding section of the List
module.
|
| find_first_value_rec [Lists] | find_first_value_rec lst x uses recursion to produce Some z
for the first pair (y,z in the list such that x equals y.
|
| find_last_value [Lists] | find_last_value_rec lst x evaluates to Some z for the last pair
(y,z in the list such that x equals y.
|
I | |
| int_to_bits [Binary] | int_to_bits n converts an int n to bits.
|
L | |
| lengths_fold [Lists] | lengths_fold is identical to lengths_rec, but uses a folding
function from the List module instead of recursion.
|
| lengths_lib [Lists] | lengths_lib is identical to lengths_fold, but uses functions other
than those in the folding section of the List module.
|
| lengths_rec [Lists] | lengths_rec l uses recursion to output a list l' such
that the nth element of l' is the length of the nth
element of l.
|
M | |
| max2 [Warmup] |
The
max2 function should return the second-greatest element in an
'a list with respect to the canonical ordering given by
Pervasives.compare.
|
| median [Lists] | median lst returns None if lst is the empty list,
and otherwise returns Some x, where x is the median
of an odd-length list or the lesser of the two middle
elements of an even-length list.
|
N | |
| normalize [Binary] | normalize lst lst' outputs (lst'',lst''') such that the
lst'' and lst''' have the same length.
|
R | |
| rev [Warmup] |
The
rev is an alias for the List.rev function which reverses a list.
|
S | |
| sum [Warmup] |
The
sum function returns the sum of the elements in a given list.
|
T | |
| to_string [Arithmetic] | to_string exp return a fully parenthesized string representation of
exp with no spaces between operators and their operands.
|
| total_length [Lists] | total_length lst outputs the total length of all lists
elements of lst.
|
| tree_count [Trees] | tree_count t counts the number of Nodes in the tree t.
|
| tree_count_fold [Trees] | tree_count_fold is identical to tree_count, but it is implemented
with tree_fold
|
| tree_fold [Trees] |
The
tree_fold function generalizes fold operator to the 'a
bintree type.
|
| tree_inorder [Trees] |
The
tree_inorder function has an analogous specification to
tree_preorder, but outputs the in-order
traversal of t.
|
| tree_inorder_fold [Trees] | tree_inorder_fold is identical to tree_inorder, but it is implemented
with tree_fold
|
| tree_mem [Trees] | tree_mem x t returns true if and only if x is an element in
t.
|
| tree_mem_fold [Trees] | tree_mem_fold is identical to tree_mem, but it is implemented
with tree_fold
|
| tree_postorder [Trees] | |
| tree_postorder_fold [Trees] | tree_postorder_fold is identical to tree_postorder, but it is implemented
with tree_fold
|
| tree_preorder [Trees] | |
| tree_preorder_fold [Trees] | tree_preorder_fold is identical to tree_preorder, but it is implemented
with tree_fold
|
| tree_sum [Trees] | tree_sum t computes the sum of the values in the Nodes of
t.
|
| tree_sum_fold [Trees] | tree_sum_fold is identical to tree_sum, but it is implemented
with tree_fold
|