Implemented Prism's MST algo: heap and non-heap versions