Please check code for Minimum Spanning Tree problem

here is your corrected code: