  We study the conditions under which the isometry of spaces with metrics
generated by weights given on the edges of finite trees is equivalent to the
isomorphism of these trees. Similar questions are studied for ultrametric
spaces generated by labelings given on the vertices of trees. The obtained
results generalized some facts previously known for phylogenetic trees and for
Gurvich-Vyalyi monotone trees.
