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