Topology For Trees And Curves: Theory And Applications