Function to calculate total number of nodes of degree d in these trees .
function numberOfNodes ( $ n , $ d ) { $ ans = binomialCoeff ( 2 * $ n - 1 - $ d , $ n - 1 ) ; echo " Number ▁ of ▁ nodes ▁ of ▁ degree ▁ 1 ▁ in " , " ▁ a ▁ tree ▁ having ▁ 4 ▁ edges ▁ : ▁ " , $ ans , " STRNEWLINE " ; return 0 ; }