Give a recursive algorithm btProd which takes as input a binary tree, and outputs the value that is the product of the numbers contained in the binary tree. If the input is the null tree, then the algorithm should return null.
Algorithm btProd(P)
Require: Input is a tree P
1: btProd(null) ← 0
2: btProd(leaf x) ← x
3: btProd(node L x R) ← btProd(L) + x + btProd(R )
That's the way i would do it but i'm not sure if that's correct