Added x86only

This commit is contained in:
Dmitry Boulytchev 2018-11-01 15:12:45 +03:00
parent 2bf7ab7091
commit 584e7a998b
5 changed files with 46 additions and 0 deletions

View file

@ -0,0 +1,19 @@
fun insert (tree, value) {
case tree of
`Empty -> return `Node (value, `Empty, `Empty)
| `Node (x, left, right) ->
if x > value
then return `Node (x, insert (left, value), right)
else return `Node (x, left, insert (right, value))
fi
esac
}
tree := `Empty;
for i := 0, i <= 10, i := i+1 do
printf ("%s\n", tree.string);
tree := insert (tree, i)
od;
printf ("%s\n", tree.string)