I can store any undirected simple graph N vertices using $b = (N-1)N/2$ bits, by creating a mask of the edges on the upper diagonal of the adjacency matrix. For example the adjacency matrix of $K_3$ is
$$ A = [[0,1,1],[1,0,1],[1,1,0]] $$
which can be stored as the bit-mask $011101110$ or as an integer in base-10 as $238$. In general, this number isn't unique (due to graph isomorphisms) but it doesn't matter for my purposes. From a practical standpoint, this means I can store graphs up to $N=11$ in a database using a 64-bit integer.
My question now involves trees, which are considerably more edge-sparse. Is there a mapping scheme that can allow me to store (and quickly reconstruct) trees $N>11$ using a single 64-bit integer?
The number of spanning trees in a graph with $n$ vertices is $n^{n-2}$, A common way to adress a tree is through its Prüfer code.
If we want to talk about trees that may not be spanning trees we could adress this issue by first assigning the vertex set of the tree and then giving its Prüfer code.
Anyways it is not possible to store every single tree on $n$ vertices using a $64$-bit intger because the number of such trees is more than $n^{n-2}$ and $n^{n-2}$ is stricty larger than $2^{64}$ for $n\geq 18$