// pqueue.h
typedef unsigned long long reallong;

class Cell {
friend class PQueue;
   void *item;  Cell *next;
   Cell(void *ptr, Cell *lst) { item = ptr;  next = lst; }
};

class PQueue {
   Cell *head, *tail;
   reallong (* valfn)(void *);

public:
   PQueue(reallong (*)(void *));
   void insert(void *);
   void enqueue(void *);
   void *dequeue();
   bool empty();
};