summaryrefslogtreecommitdiff
path: root/prolog/problems/trees/deletebt_3/common.py
blob: 98ad95ff45300aba94965e2c0f772094c9967c35 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# coding=utf-8

id = 137
number = 47
visible = True
facts = None

solution = '''\
deleteBT(X, b(nil, X, nil), nil).
deleteBT(X, b(b(Ls, E, Rs), X, R), b(L, E, R)) :-
  deleteBT(E, b(Ls, E, Rs), L).
deleteBT(X, b(L, X, b(Ls, E, Rs)), b(L, E, R)) :-
  deleteBT(E, b(Ls, E, Rs), R).
deleteBT(X, b(L, E, R), b(L1, E, R)) :-
  deleteBT(X, L, L1).
deleteBT(X, b(L, E, R), b(L, E, R1)) :-
  deleteBT(X, R, R1).
'''