Parent pointer tree

Spaghetti stack with an "active" stack frame highlighted

In computer science, an in-tree or parent pointer tree is an N-ary tree data structure in which each node has a pointer to its parent node, but no pointers to child nodes. When used to implement a set of stacks, the structure is called a spaghetti stack, cactus stack or saguaro stack (after the saguaro, a kind of cactus).[1] Parent pointer trees are also used as disjoint-set data structures.

The structure can be regarded as a set of singly linked lists that share part of their structure, in particular, their tails. From any node, one can traverse to ancestors of the node, but not to any other node.

  1. ^ Clinger, W.; Hartheimer, A.; Ost, E. (1988). "Implementation strategies for continuations". Proceedings of the 1988 ACM conference on LISP and functional programming - LFP '88. pp. 124–131. doi:10.1145/62678.62692. ISBN 089791273X.