summaryrefslogtreecommitdiff
path: root/prolog/problems/trees/deletebt_3/common.py
blob: 52f9e3fc94f2c3b9f26395b7df32e25bfb85b015 (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 = False
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).
'''