Let $G = (V,E) $ and let be $T \subseteq V$ . $T$ is called vertex cover if each edge of the graph is incident to at least one vertex of $T$ .
Let be the following decisional problem :
$PROBLEM$
Input : $G = (V,E) $ with $n$ nodes ; $k\in \mathbb{N}$ , $k \le n$
Output : $YES$ if exists $T$ such that $T$ is vertex cover with $|T| \le k $ , else $NO$
$a)$ Proof the correctness of the following algorithm for solving $PROBLEM$ :
$V-COV ( G , k ) $
$IF$ ( $E(G)$ = $\emptyset $ ) then $return$ ($YES$ , $\emptyset$) ;
$IF$ ( $E(G)$ > $k$ * ($|V(G)|$-1) ) then $return$ $NO$ ;
Let $\{u,v\}$ $\in$ $E(G)$ ;
$IF$ ( ($V-COV ( G - u , k- 1 ) $ return ($YES$ , $T$ ) ) then $return$ ($YES$ , $T \cup \{u\}$) ;
$ELSE$ $IF$ ( ($V-COV ( G - v , k- 1 ) $ return ($YES$ , $T$ ) ) then $return$ ($YES$ , $T \cup \{v\}$) ;
$ELSE$ $return$ $NO$ ;
$b)$ Find out time complexity $T(n,k)$ for this algorithm and prove if $k$ is constant then it has a polynomial time complexity .
For $a)$ the first $IF$ statement is trivial .. but the others ? For $b)$ vertex cover is in $NP$ , right ? So it has exponential time complexity , right ? I wait answers please ..