Function to calculate the number of trees with exactly k leaves .
function k_Leaves ( $ n , $ k ) { $ ans = ( binomialCoeff ( $ n , $ k ) * binomialCoeff ( $ n , $ k - 1 ) ) / $ n ; echo " Number ▁ of ▁ trees ▁ having ▁ 4 ▁ edges ▁ and ▁ " , " exactly ▁ 2 ▁ leaves ▁ : ▁ " , $ ans , " STRNEWLINE " ; return 0 ; }