2
0
Fork 0
mirror of https://github.com/MartinThoma/LaTeX-examples.git synced 2025-04-26 06:48:04 +02:00

Misc; E-Mail von Moritz

This commit is contained in:
Martin Thoma 2014-04-05 18:18:47 +02:00
parent 9c0864f122
commit 0508de3f6a
14 changed files with 122 additions and 16 deletions

View file

@ -0,0 +1,10 @@
cbal_tree(0,nil) :- !.
cbal_tree(N,t(x,L,R)) :- N > 0,
N0 is N - 1,
N1 is N0//2, N2 is N0 - N1,
distrib(N1,N2,NL,NR),
cbal_tree(NL,L), cbal_tree(NR,R).
distrib(N,N,N,N) :- !.
distrib(N1,N2,N1,N2).
distrib(N1,N2,N2,N1).