third handout graph and tree algorithms 5772527