This function returns size of tree rooted with given root . It also set " res " as true if there is an edge whose removal divides tree in two halves . n is size of tree
def checkRec ( root , n ) : NEW_LINE INDENT global res NEW_LINE DEDENT