The algorithm described by the book does not return the minimum tree. This is demonstrated by the book on page 633 of the ebook where the result has a total weight of 37, while running the Prim algorithm from the book returns a total of 35, as seen on page 635.
Figure out why this behavior is not considered as invalid.
The algorithm described by the book does not return the minimum tree. This is demonstrated by the book on page 633 of the ebook where the result has a total weight of 37, while running the Prim algorithm from the book returns a total of 35, as seen on page 635.
Figure out why this behavior is not considered as invalid.