Bintree
The module allows you to generate your own binary trees and display them beautifully.
Installation
This package available in Hex and can be installed
by adding bintree to your list of dependencies in mix.exs:
def deps do
[
{:bintree, "~> 1.1.0"}
]
endUsage
Bintree.new(2, &(&1*2), &(&1 * 3), 4)
|> Bintree.to_string()
|> IO.puts()
# Result:
# 2
# |
# /---------------\
# | |
# 4 6
# | |
# /-------\ /-------\
# | | | |
# 8 12 12 18
# | | | |
# /---\ /---\ /---\ /---\
# | | | | | | | |
#16 24 24 36 24 36 36 54