Graph TheoryMediumTrees
Trees · Medium problem
A caterpillar-shaped tree has a spine of vertices in a row. Each internal spine vertex (every spine vertex except the two ends) carries exactly pendant leaves, and each of the two spine ends carries exactly pendant leaf. If the tree has leaves in total, how many vertices are on the spine?