1

I am learning to implement tree algorithms and often I need to test my algorithms by generating different binary tree, which i do manually. I tried writing functions for it but it will not generate all possible trees. Any help is highly appreciated.

Vikrant Singh
  • 669
  • 1
  • 6
  • 18

1 Answers1

1

if you use Python, maybe the binarytree module is what you need

>>> from binarytree import tree
>>> t = tree(height=3)
>>> t.pprint()

         _______8_____
        /             \
    ___3___            2
   /       \          / \
  14       _4       _5   12
 /  \     /  \     /       \
6    7   10   0   13        11
Su Kai
  • 21
  • 4