Algorithm: Prim's MST Input : G, a connected, weighted, undirected graph with n vertices and e edges r, a vertex in G Output: T a minimum weight spanning tree for G 0. mark each vertex's parent as "unknown" except r, which has parent nil ← i.e. only r is in the current MST 1. select vertex v with parent "unknown" with edge (u,v), where u's parent is not "unknown", such that (u,v) has minimum weight amongst all such edges 2. set v's parent to u ← i.e. add v to thecurrent MST by connecting it to u 3. goto Step 1
The big takeaway is this: we usually think of greedy algorithms first in this very broad terms - what's the greedy choice. Once we've found a greedy choice that works, i.e. produces optimum solutions, then we still have a ways to go before we get a concrete algorithm - something that's descrived sufficiently to analyze.