Samsung Electronics Interview Question

One question on prims algorithm followed by a discussion on my projects