Function to print the nodes with prime degree in the tree whose Prufer sequence is given
void PrimeDegreeNodes ( int prufer [ ] , int n ) { int nodes = n + 2 ; bool prime [ nodes + 1 ] ; memset ( prime , true , sizeof ( prime ) ) ; SieveOfEratosthenes ( prime , nodes + 1 ) ;