>and it's so difficult to learn some one don't know !
I gave you the exact name of two algorithms that find a minimum spanning tree. What more do you want? Me to write up two super easy implementations and describe how every line works? I didn't feel the need to do that when just about every result from Google has sample code.
>what can i do if teachers don't explain it , and there is no time to search and search . http://en.wikipedia.org/wiki/Prim's_algorithm
That's the first result from Google. It took me about 5 seconds to search and search. Stop being a weenie and show some effort.