  We describe a simple efficient algorithm that allows one to construct
Monte-Carlo realizations of merger histories of dark matter halos. The
algorithm is motivated by the excursion set model (Bond et al. 1991) for the
conditional and unconditional halo mass functions. The forest of trees
constructed using this algorithm depends on the underlying power spectrum. For
Poisson or white-noise initial power-spectra, the forest has exactly the same
properties as the ensemble of trees described by Sheth (1996) and Sheth &
Pitman (1997). In this case, many ensemble averaged higher order statistics of
the tree distribution can be computed analytically. For Gaussian initial
conditions with more general power-spectra, mean properties of the ensemble
closely resemble the mean properties expected from the excursion set approach.
Various statistical quantities associated with the trees constructed using our
algorithm are in good agreement with what is measured in numerical simulations
of hierarchical gravitational clustering.
