function pruefer_check_test ( )

%*****************************************************************************80
%
%% pruefer_check_test() tests pruefer_check().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    23 December 2015
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'pruefer_check test():\n' );
  fprintf ( 1, '  pruefer_check() checks a Pruefer code.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Check?   N    P(1:N-2)\n' );
  fprintf ( 1, '\n' );
  
  for test = 1 : 4

    if ( test == 1 )
      n = 2;
      p = [ ];
    elseif ( test == 2 )
      n = 3;
      p = [ 1 ];
    elseif ( test == 3 )
      n = 4;
      p = [ 5, 2 ];
    elseif ( test == 4 )
      n = 5;
      p = [ 5, 1, 3 ];
    end

    check = pruefer_check ( n, p );
    fprintf ( 1, '      %5s  %2d:  ', mat2str ( check ), n );
    for i = 1 : n - 2
      fprintf ( 1, '  %2d', p(i) );
    end
    fprintf ( 1, '\n' );

  end

  return
end
