MartinThoma/LaTeX-examples

not really a binary tree

Opened this issue · 6 comments

First, thanks for making some examples to those who are beginners to tikz, but I would like to point out that the binary-tree example is not actually a binary tree. If a node has only one child it should be clear if it is a left child or a right one (contrary to what is achieved by drawing it below its parent node)

A binary tree is a tree where each node has at most two children.

Yes, but "(...) the relative positions of the children is significant. "
As stated in
http://mathworld.wolfram.com/BinaryTree.html
and
http://en.wikipedia.org/wiki/Binary_tree
and many others

The order of children might be significant for many applications, but that does not mean it is part of the definition.

It is part of the definition. As you can see in almost every academic book referring to binary trees. Main reference should be "The art of computer programming vol 1. Fundamental Algorithms" (Knuth) so a node with a left child only is structurally different to a node with a right child

I will not continue to argue about this. I gave a proper definition of a binary tree which is widely used. If you like other definitions of binary trees you are free to use them. I will stick to the definition I know.

It is ok, if you want so. Just to let you know, Knuth, the author of the book I referenced is also the creator of TeX, and basically an authority in Computer Science, use your own def if it makes you happy