bdqueues

bdqueues - int BdqueuesSize(Bdqueues Q, int *Q1size, int...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
/* bdqueues.h - balanced double queues interface */ #include "gend.h" #ifndef _BDQUEUES_H #define _BDQUEUES_H #define MAX_BDQ 1000 /*500 in each queue */ typedef gend BdqueuesItemType; typedef enum _bool {false, true} bool; typedef struct _bdqueuesCDT *Bdqueues; /* allocates memory for the new balanced dual queues */ Bdqueues CreateBdqueues(); /* deallocate all storage associated with the balanced double queues */ void DestroyBdqueues(Bdqueues Q); /* return true only if both queues are empty */ bool EmptyBdqueues(Bdqueues Q); /* returns the sum of the lengths of both queues and the length of each queue by reference */
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: int BdqueuesSize(Bdqueues Q, int *Q1size, int *Q2size); /* return true is both queues have MAX_BDQ items total */ bool FullBdqueues(Bdqueues Q); /* inserts item on the shorter queue or on either if both queues have the same length.*/ bool EnqueueBdq(Bdqueues Q, BdqueuesItemType newItem); /* removes item and return it*/ bool DequeueBdqQ1(Bdqueues Q,BdqueuesItemType *item); bool DequeueBdqQ2(Bdqueues Q,BdqueuesItemType *item); /* return item */ bool getBDQ1Front(Bdqueues Q,BdqueuesItemType *item ); bool getBDQ2Front(Bdqueues Q,BdqueuesItemType *item ); #endif...
View Full Document

This note was uploaded on 01/17/2012 for the course CSC 1254 taught by Professor Blanks,l during the Fall '08 term at LSU.

Ask a homework question - tutors are online