In this paper we present O(n)-time algorithms for encoding/decoding n-node labeled trees as sequences of n−2 node labels. All known encodings of this type are covered, including Prüfer-like codes and the three codes proposed by Picciotto the happy, blob, and dandelion codes. The algorithms for Picciotto’s codes are of special significance as previous publications describe suboptimal approaches ...