ADOBE Interview Paper, 6th September 2010

Engineering Round: (15 question)1 Finding height of binary tree2. Number of times multiplication is required:
int computeXn(int x int n)
{
if(n%2=0)
{
return x*x;
}
else if(n%2=0)
{
int y computeXn(x n/2);
return y*y;
}
else if(n%2=1)
{
int y computeXn(x n/2);
return y*y*x;
}
}
Calculating power of a tree for 5^12.3. Polynomial A+Bx+Cx^2+….+Nx^(n-1) this representation is more suitable for which