Is there a way to serialize any tree?
Mind maps are trees. Text is serial. I wonder if there is an elegant way to serialize trees.
An n-ary tree can be serialized, if we represent the absence of a node as NULL. But that is not intuitive. We do not think in terms of "two absences of new ideas".
Trees can be serialized recursively. But that solution is complicated, making use of lines and indentation. Git's commit history feels similar.
Trees, as graphs, can be described by their nodes and edges. Somehow that comes across as describing the behavior and history of a tree than itself to me, which may not even make sense.
Is there a well-known, simple, elegant way to serialize infinite -ary trees? Equivalently, is there an innate, implicit representation for trees, and trees alone? On a related note, how can I define a tree purely generatively, instead of "graphs that satisfy such and such qualities"? Or perhaps, is there a textbook on such topics that a non-CS major can read up on?