recursive function, C/C++ Programming

Binomial coefficients are the numeric factors of the products in a power of a binomial such as (x + y)n. For example, (x + y)2 = x2 + 2 x y + y2 has the coefficients 1 2 1. Binomial coefficients can be calculated using Pascal''s triangle:
1 n = 0
1 1
1 2 1
1 3 3 1
1 4 6 4 1 n = 4
Each new level of the triangle has 1''s on the ends; the interior numbers are the sums of the two numbers above them. Write a program that includes a recursive function to produce a list of binomial coefficients for the power n using the Pascal''s triangle technique. For example,
Input = 2 Output = 1 2 1
Input = 4 Output = 1 4 6 4 1
Posted Date: 12/1/2012 11:53:22 AM | Location : Pakistan







Related Discussions:- recursive function, Assignment Help, Ask Question on recursive function, Get Answer, Expert's Help, recursive function Discussions

Write discussion on recursive function
Your posts are moderated
Related Questions
The size of () operator This is a pseudo-operator given by the language, which returns the number of bytes taken up by a variable or data type. The value returned by this opera

WAP TO PRINT NUMBERS FROM 1-50 WHICH ARE DIVIDED BY 7 void main () { int a; clrscr (); a=1; while (a { if (a%7==0) printf ("%d\n",a); a++; } ge

Explain Formatted Input Output with File Pointer? Likewise there are equivalents to the functions scanf and printf which write or read data to files. These are called fscanf a

What are the benefits of using friend classes? - Friend classes are useful when a class wants to hide features from users which are required only by another, tightly coupled cl

Ask questioGiven an integer n and a permutation of numbers 1, 2 ... , n-1, n write a program to print the permutation that lexicographically precedes the given input permutation. I


implement two stacks in one array A[1...n] in such a way that neither stack overflows unless the total number of elements in both stacks together is n. For this you need to produce

how many bytes required to char

Given an integer n and a permutation of numbers 1, 2 ... , n-1, n write a program to print the permutation that lexicographically precedes the given input permutation. If the given

Array types An array is a collection of objects of a one data type. The individual objects are accessed by their position in the array. This way of accessing is known as indexi