Function to calculate the number of trees in which the root has degree r .
int rootDegreeR ( int n , int r ) { int ans = r * binomialCoeff ( 2 * n - 1 - r , n - 1 ) ; ans = ans / n ; cout << " Number ▁ of ▁ trees ▁ having ▁ 4 ▁ edges " << " ▁ where ▁ root ▁ has ▁ degree ▁ 2 ▁ : ▁ " << ans << endl ; return 0 ; }