AVLTree

 view release on metacpan or  search on metacpan

lib/AVLTree.pm  view on Meta::CPAN

  Arg [...]   : None
  
  Example     : my $item = $tree->first;

  Description : Returns the first element as specified by the order defined by the tree.

  Returntype  : The item, if found, as stored in the tree or undef
                if the tree is empty.
  Exceptions  : None
  Caller      : General
  Status      : Unstable

=head2 C<last>

  Arg [...]   : None

  Example     : my $item = $tree->last;

  Description : Returns the last element as specified by the order defined by the tree.

  Returntype  : The item, if found, as stored in the tree or undef
                if the tree is empty.
  Exceptions  : None
  Caller      : General
  Status      : Unstable

=head2 C<next>

  Arg [...]   : None

  Example     : my $item = $tree->first;
                print $item, "\n";
                while($item = $tree->next) { print $item, "\n"; }

  Description : Returns the next element as specified by the order defined by the tree.

  Returntype  : The item, if found, as stored in the tree or undef
                if the tree is empty.
  Exceptions  : None
  Caller      : General
  Status      : Unstable

=head2 C<prev>

  Arg [...]   : None

  Example     : my $item = $tree->last;
                print $item, "\n";
                while($item = $tree->prev) { print $item, "\n"; }

  Description : Returns the previous element as specified by the order defined by the tree.

  Returntype  : The item, if found, as stored in the tree or undef
                if the tree is empty.
  Exceptions  : None
  Caller      : General
  Status      : Unstable

=head1 DEPENDENCIES

AVLTree requires Carp and Test::More, Test::Deep and Test::LeakTrace to run the tests during installation.
If you want to run the benchmarks in the scripts directory, you need to install the Benchmark 
and List::Util modules.

=head1 EXPORT

None

=head1 SEE ALSO

If you want to get a deeper insight into the module, you should of course take a look at the excellent AVL 
tree library developed by Julienne Walker L<http://www.eternallyconfuzzled.com/jsw_home.aspx>. 

There are of course other modules which provide this functionality, see e.g. Tree::AVL, Btrees.
You can appreciate the power of this module by running some benchmarking against the above.
If you've installed from source, go to the installation directory and:  

  cd scripts
  perl benchmarking.pl

Preliminary experiments suggest speed gains of one order of magnitude.

To the best of my knowledge, there are no modules using Perl XS attempting to implement AVL
trees in the most efficient possible way. The closest thing is Tree::Fat, a Perl extension
to implement Fat-Node trees.

=head1 AUTHOR

Alessandro Vullo, C<< <avullo at cpan.org> >>

=head1 BUGS

Please report any bugs or feature requests to C<bug-avltree at rt.cpan.org>, or through
the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=AVLTree>.  I will be notified, and then you'll
automatically be notified of progress on your bug as I make changes.

=head1 CONTRIBUTING

You can obtain the most recent development version of this module via the GitHub
repository at https://github.com/avullo/AVLTree. Please feel free to submit bug
reports, patches etc.

=head1 SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc AVLTree

You can also look for information at:

=over 4

=item * RT: CPAN's request tracker (report bugs here)

L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=AVLTree>

=item * AnnoCPAN: Annotated CPAN documentation

L<http://annocpan.org/dist/AVLTree>

=item * CPAN Ratings



( run in 0.753 second using v1.01-cache-2.11-cpan-3782747c604 )