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