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

id = 141
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).
'''