Included lama compilation in root's make regression target

This commit is contained in:
Egor Sheremetov 2023-09-04 13:25:12 +02:00
parent 52ef663986
commit 89536c67e0
3240 changed files with 14640 additions and 6 deletions

View file

@ -0,0 +1,32 @@
var n, t;
fun insert (t, x) {
case t of
Leaf -> Node (x, Leaf, Leaf)
| Node (y, l, r) -> if x > y
then Node (y, insert (l, x), r)
else Node (y, l, insert (r, x))
fi
esac
}
fun find (t, x) {
case t of
Leaf -> 0
| Node (y, l, r) -> if x == y then 1
elif x > y then find (l, x)
else find (r, x)
fi
esac
}
n := read ();
t := insert (insert (insert (insert (Leaf, 5), 4), 6), 3);
write (find (t, 5));
write (find (t, 4));
write (find (t, 6));
write (find (t, 3));
write (find (t, 2));
write (find (t, 1))