UST interview question

Explain minimum spanning tree with example and code snippet