ExamVeda
Login
Home
Miscellaneous on Data Structures
?

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)

Answer & Solution
Correct Answer: Option B
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.