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

id = 140
number = 45
visible = True
facts = None

solution = '''\
depthBT(nil, 0).
depthBT(b(L, _, R), D) :-
  depthBT(L, DL),
  depthBT(R, DR),
  (DL >= DR,
   D is DL + 1
   ;
   DL < DR,
   D is DR + 1).
'''