summaryrefslogtreecommitdiff
path: root/prolog/problems/trees/numberbt_2/en.py
blob: 4cab0f84be1e06c7fcee51f3ffb9050f3f0ace63 (plain)
1
2
3
4
5
6
7
8
9
10
11
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 = {}