Exact solutions for Sturm–Liouville problems on trees via novel substitute systems and the Wittrick–Williams algorithm