function value = i4vec_median ( n, a )

%*****************************************************************************80
%
%% i4vec_median() returns the median of an unsorted I4VEC.
%
%  Discussion:
%
%    Hoare's algorithm is used.  
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    17 April 2005
%
%  Input:
%
%    integer N, the number of elements of A.
%
%    integer A(N), the array to search.
%
%  Output:
%
%    integer VALUE, the value of the median of A.
%
  k = floor ( ( n + 1 ) / 2 );

  value = i4vec_frac ( n, a, k );

  return
end
