Examveda

What is the output of the following code in python, if the input is given as 8?
def CatalanNumber(n): 
    if n<= 1 : 
        return 1 
    result=0
    for x in range(n): 
        result = result + CatalanNumber(x) * CatalanNumber(n-x-1) 
    return result
n=int(input("Enter the number:"))
answer=CatalanNumber(n)
print(" ", answer)

A. 1432

B. 1430

C. 1438

D. 1462

Answer: Option B


This Question Belongs to Data Structure >> Miscellaneous On Data Structures

Join The Discussion

Related Questions on Miscellaneous on Data Structures