Function to find the height of the tree
Node * BuildKaryTree ( int * A , int n , int k , int ind ) { int height = ( int ) ceil ( log ( ( double ) n * ( k - 1 ) + 1 ) / log ( ( double ) k ) ) ; return BuildKaryTree ( A , n , k , height , ind ) ; }