We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I do not get the second example. You start on A, with two options, of weight 3 (B) and 4 (C)
After picking B, one have the following options:
A-C (4), B-C (5), B-D (6) and B-E (2). So one pick B-E. Until then, okay.
But now we have A-C (4) B-C (5), B-D (6) and E-C (1), so we should pick E-C. Why did the example pick A-C ?
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Prim's (MST) : Special Subtree
You are viewing a single comment's thread. Return to all comments →
I do not get the second example. You start on A, with two options, of weight 3 (B) and 4 (C) After picking B, one have the following options: A-C (4), B-C (5), B-D (6) and B-E (2). So one pick B-E. Until then, okay.
But now we have A-C (4) B-C (5), B-D (6) and E-C (1), so we should pick E-C. Why did the example pick A-C ?