From Konig's Theorem, the size of Maximum Matching (|M|) and minimum vertex cover is the same. Now we can include both ends of the matching in the vertex cover to find a vertex cover, but its size will be 2|M|. So I considered choosing a matching edge and then checking the degree of both ends. And then include the vertex with the higher degree. Suppose the degree of both ends is the same. We can include either. I tried this with a few examples I could think of it worked. But I am not sure of the algorithm. Is this correct? Also, if not, can anyone provide any counter-example?
I have seen other algorithms for this. I just wanted to see the issue with my approach.