[comp.lang.pascal] Linked Queue implementation

SJPERRY%CSBSJU.BITNET@uga.cc.uga.edu (03/14/91)

        Does anyone happen to have the code handy for a linked-list
        implementation of a priority-based queue in C or Pascal?

        The priority queue is a minor part of a large project
        and it seemed kinda silly to reinvent (reprogram) the
        wheel... thanks in advance.

        Steve P.

bigelow@hpfcso.FC.HP.COM (Jim Bigelow) (03/16/91)

>         Does anyone happen to have the code handy for a linked-list
>        implementation of a priority-based queue in C or Pascal?

I recommend a min-heap rather then a link-list for a priority queue,
much faster.  You can see both the code and a nice description in
"Fundamentals of Data Structures iin Pascal", Horowitz and Sahni, 3rd
Edition  Computer Science Press, 1990.

Enjoy,

Jim Bigelow
HP9000/ S300 & S400 Pascal
Colorado Language Lab.
HP
Ft. Collins, CO