A new coding algorithm (called NTUPLE) for computing the N-tuple code (due to Knop et al.) for chemical trees is proposed. The algorithm NTUPLE has a time complexity in O(N), where N is the number of vertices of the tree instance, on a RAM machine and a time complexity in O(N2) on a machine with words of length. A varient of the N-tuple code, called the centered N-tuple code, is also introduced,
... [Show full abstract] and a coding algorithm (called CENTERTUPLE) to compute it is provided. The algorithm CENTERTUPLE has a time complexity in O(N) on a RAM machine and in O(N log N) on a machine with words of bounded length. C implementations of both coding algorithms are included.