Added generalized pre-order, post-order algorithms