summaryrefslogtreecommitdiff
path: root/prolog/problems/trees/numberbt_2/en.py
blob: 3be193d2d0f00ac1b00fc0738546775a23ffd693 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# coding=utf-8

name = 'numberBT/2'
slug = 'find the number of nodes in a binary tree'

description = '''\
<p><code>numberBT(T, N)</code>: <code>N</code> is the number of nodes in the binary tree <code>T</code>.</p>
<pre>
  ?- numberBT(b(b(nil,2,nil),1,b(nil,3,nil)), N).
    N = 3.
</pre>'''

hint = {}