-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbqueue.h
More file actions
39 lines (31 loc) · 989 Bytes
/
Copy pathbqueue.h
File metadata and controls
39 lines (31 loc) · 989 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#pragma once
#include <iostream>
#include <string>
using namespace std;
/*********************************************************************************************
b q u e u e . h (given class declarations)
**********************************************************************************************
Description: QUEUE (doubly linked list) first come first out
*********************************************************************************************/
#ifndef QUEUE
#define QUEUE
class bqnode
{
public:
int priority;
bqnode* prev,* next;
};
class bqueue
{
public:
bqueue(); // default constructor
~bqueue(); // destructor
bqueue(const bqueue&); // copy constructor
void enqueue(const int&); // adding a new item to the queue
void dequeue(); // delete queue
bool empty() { return front == 0;} // empty checker
void print(); // print queue
private:
bqnode* front; //use ONLY one pointer
};
#endif