summaryrefslogtreecommitdiff
path: root/prolog/problems/trees/tolistbt_2/common.py
blob: 6df7cddf1e05813f833143343bb5b8191e978753 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
id = 141
group = 'trees'
number = 46
visible = True
facts = None

solution = '''\
conc141([], L, L).
conc141([H|T], L2, [H|L]) :-
  conc141(T, L2, L).

tolistBT(nil, []).
tolistBT(b(L, E, R), List) :-
  tolistBT(L, LL),
  tolistBT(R, RL),
  conc141(LL, [E|RL], List).
'''