A gem to convert a binary tree to array and vice versa.
gem install binary_trees
root = [1, 2, 3, 4, 5, 6].to_root
tree = Tree.new(root)
root.val # == 1
root.left.right.val # == 5
tree.sum # == 11
tree.to_a
tree.invert # return root [1, 3, 2, nil, 6, 5, 4]