We compute sum of alternate levels starting first level and from second level . And return maximum of two values .
return Math . max ( getSumAlternate ( root ) , ( getSumAlternate ( root . left ) + getSumAlternate ( root . right ) ) ) ; }