A priority queue data structure for Perl 6
Perl6
Switch branches/tags
Nothing to show
Latest commit d557993 Apr 21, 2017 @hoelzro committed on GitHub Merge pull request #3 from samcv/license-SPDX
Use SPDX identifier in license field of META6.json

README.md

NAME

PriorityQueue

VERSION

0.01

SYNOPSIS

    use PriorityQueue;

    my $p = PriorityQueue.new;

    for 1 .. 100 {
        $p.push: 100.rand.floor;
    }

    # should return in increasing order
    while $p.shift -> $e {
        say $e;
    }

    # if you want a max heap, or just a different ordering:
    $p = PriorityQueue.new(:cmp(&infix:«>=»));

DESCRIPTION

This class implements a priority queue data structure.

AUTHOR

Rob Hoelz