1
$\begingroup$

Let's say I have a forest of x trees (a bunch of disconnected trees). How many edges must be added to convert the forest into a single, contiguous tree?

Wouldn't it just be x-1 edges?

The problem also states that the trees have $y_1, y_2, ..., y_x$ vertices, respectively, and I don't understand why this information is relevant.

Am I misinterpreting something?

$\endgroup$
  • 1
    $\begingroup$ $x-1$ is correct, $y_k$ are irrelevant. $\endgroup$ – Mike Earnest Sep 28 '18 at 19:40
1
$\begingroup$

If you're unconvinced, try a proof by induction. Start with the case where $x=2$. Then assume it works when you have $n$ trees and look at what happens when you have $n+1$ trees.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.