So there are two approaches to representing trees and other graphs:
The first is better when the program is working with one graph which remains unchanged throughout. For instance, a program to simulate a network of computers. This could be given a set of clauses defining the layout of the network, and then work on that.
The second is better when the program needs to create lots of new graphs. For example, programs for grammatical analysis, or for reducing finite-state machines, or for pasting categorical diagrams.