Pre- and in-order for binary trees

Probably does not work if there are duplicate elements in the sequences.