Function to find the height of the tree
def BuildKaryTree ( A , n , k , ind ) : NEW_LINE INDENT height = int ( ceil ( log ( float ( n ) * ( k - 1 ) + 1 ) / log ( float ( k ) ) ) ) NEW_LINE return BuildkaryTree ( A , n , k , height , ind ) NEW_LINE DEDENT