TEST
17
matricola: ______________________________
nome (solo se non si ricorda la matricola):
__________________________________
- Definire le nozioni di scoping statico e scoping dinamico.
- Assume to have the data type of numeric labelled binary
tree in Scheme with the following constructors, predicates and
selectors: EmptyNBT, MkNBT, EmptyNBT?, LabelRootNBT, LeftNBT, RightNBT.
Define the function Insert
which, taken as input a number n and search tree t (i.e. a NBTree in
which the label of any node is always greater or equal to every
label of its left subtree and less than every label of its right
subtree) , returns another search tree, like t, but with a a new
leaf with label n.
- Definire un predicato Scheme che, preso un naturale n ed
una funzione f da naturali a naturali, restituisca #t se e solo se (f
0) < (f 1) < ... < (f n) .