summaryrefslogtreecommitdiff
path: root/prolog/problems/trees/numberbt_2/en.py
blob: 99dc9ca951adf3de68629137fda466a71455fd56 (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 = {}