Rebuilding a tree from its traversals: a case study of program inversion
Written on June 20, 2007
S-C. Mu and R. S. Bird. In The First Asian Symposium on Programming Languages and Systems, LNCS 2895, pp. 265-282, Bejing, 2003.
[GZipped Postscript]
Given the inorder and preorder traversal of a binary tree whose labels are all distinct, one can reconstruct
the tree. This article examines two existing algorithms for rebuilding the tree in a functional framework, using existing theory on function inversion. We also present a new, although complicated, algorithm by trying another possibility not explored before.
Filed in: Conference.
Tags: Converse-of-a-Function Theorem, Program Derivation, Program Inversion.