mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-02-10 14:05:17 +08:00
cpp lint fixes and instantiate template classes
Signed-off-by: Krishna Vedala <7001608+kvedala@users.noreply.github.com>
This commit is contained in:
@@ -1,31 +1,31 @@
|
||||
/* This class specifies the basic operation on a queue as a linked list */
|
||||
#ifndef QUEUE_H
|
||||
#define QUEUE_H
|
||||
#ifndef DATA_STRUCTURES_QUEUE_QUEUE_H_
|
||||
#define DATA_STRUCTURES_QUEUE_QUEUE_H_
|
||||
|
||||
/* Definition of the node */
|
||||
/** Definition of the node */
|
||||
template <class Kind>
|
||||
struct node {
|
||||
Kind data;
|
||||
node<Kind> *next;
|
||||
};
|
||||
|
||||
/* Definition of the queue class */
|
||||
/** Definition of the queue class */
|
||||
template <class Kind>
|
||||
class queue {
|
||||
public:
|
||||
void display(); /* Show queue */
|
||||
queue(); /* Default constructor*/
|
||||
~queue(); /* Destructor */
|
||||
bool isEmptyQueue(); /* Determine whether the queue is empty */
|
||||
void enQueue(Kind item); /* Add new item to the queue */
|
||||
Kind front(); /* Return the first element of the queue */
|
||||
void deQueue(); /* Remove the top element of the queue */
|
||||
void display(); /**< Show queue */
|
||||
queue(); /**< Default constructor*/
|
||||
~queue(); /**< Destructor */
|
||||
bool isEmptyQueue(); /**< Determine whether the queue is empty */
|
||||
void enQueue(Kind item); /**< Add new item to the queue */
|
||||
Kind front(); /**< Return the first element of the queue */
|
||||
void deQueue(); /**< Remove the top element of the queue */
|
||||
void clear();
|
||||
|
||||
private:
|
||||
node<Kind> *queueFront; /* Pointer to the front of the queue */
|
||||
node<Kind> *queueRear; /* Pointer to the rear of the queue */
|
||||
node<Kind> *queueFront; /**< Pointer to the front of the queue */
|
||||
node<Kind> *queueRear; /**< Pointer to the rear of the queue */
|
||||
int size;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif // DATA_STRUCTURES_QUEUE_QUEUE_H_
|
||||
|
||||
Reference in New Issue
Block a user