| 1 | initial version |
You should have a look at LabelledBinaryTree
sage: t1 = LabelledBinaryTree([None, None], label=3)
sage: t2 = LabelledBinaryTree([None, None], label=4)
sage: t = LabelledBinaryTree([t1,t2], label=-2)
sage: t
-2[3[., .], 4[., .]]
And easier to read
sage: ascii_art(t)
-2
/ \
3 4
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.