title: When should I use Kruskal as opposed to Prim (and vice versa)?
body: <p>I was wondering when one should use <a href="http://en.wikipedia.org/wiki/Prim%27s_algorithm" rel="noreferrer">Prim's algorithm</a> and when <a href="http://en.wikipedia.org/wiki/Kruskal%27s_algorithm" rel="noreferrer">Kruskal's</a> to find the minimum spanning tree? They both have easy logics, same worst cases, and only difference is implementation which might involve a bit different data structures. So what is the deciding factor?</p>