If you add the smallest edge adjacent to edges you have already added, you are doing
Prim's algorithm
. If you add the smallest edge in the entire graph, you are following
Kruskal's algorithm
.