According to the hierarchical scenario, galaxies form via merging and accre
tion of small objects. Using N-body simulations, we study the frequency of
merging events in the history of the halos. We find that at z less than or
similar to 2 the merging rate of the overall halo population can be describ
ed by a simple power law, (1 + z)(3). The main emphasis of this paper is on
the effects of environment of halos at the present epoch (z = 0). We find
that the halos located inside clusters have formed earlier (Deltaz approxim
ate to 1) than isolated halos of the same mass. At low redshifts (z < 1), t
he merger rate of cluster halos is 3 times lower than that of isolated halo
s and twice as low as that of halos that end up in groups by z = 0. At high
er redshifts (z <similar to> 1-4), progenitors of cluster and group halos h
ave 3-5 times higher merger rates than isolated halos. We briefly discuss t
he implications of our results for galaxy evolution in different environmen
ts.