Solutions to exercises from "Algorithms on Strings, Trees and Sequences" by Dan Gusfield