Read in a tree and estimate all subtrees of that tree. Store the subtrees as an object.
Calculate a distance metric from your tree to each one of the subtrees. The phangorn library (and others) will calculate the standard bipartition distance (Robinson-Foulds) between pairs of trees; if there is a distance of zero from your tree to one of the subtrees, you know that your tree is identical in branching structure to that subtree.
This can be easily accomplished in R. Hope this helps.
What's you representation of the trees? In which file format do you store them?