MTMO: an efficient network-centric algorithm for subtree counting and enumeration