PCMTreePreorder function

Pre-order tree traversal