Variant of greedy algorithm for vertex cover Does the following approximation algorithm for vertex cover also have an approximation ratio of 2? Why? Why not?

Input: $G = (V,E)$


Set $C \gets \emptyset$ and $E' \gets E$.
while $E' \neq \emptyset$ do:


Pick any edge $(u,v) \in E'$.
$C \gets C \cup \{u\}$.
Remove from $E'$ all edges incident to $u$.

return $C$.
No, this is a terrible algorithm. Consider a star graph: the vertices are $x,y_1,\ldots,y_n$, and the edges are $(x,y_1),\ldots,(x,y_n)$. Your algorithm goes over the edges in an arbitrary order, and always picks the $y$ vertices. It ends up with $n$ vertices rather than the optimal $1$ vertex solution.