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

id = 137
group = 'trees'
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).
'''