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