Skip to content

DreamVB/Queue-Implementation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Queue-Implementation

A Genetic queue algorithm using linked list.

Queue Operations

Function Description
enqueue push a value on the queue.
dequeue Return a value of the queue and remove.
peek Return the top value on the queue.
empty Tell us if the queue is empty or not.

Using the Queue

#include "LQue.h"
using namespace std;

int main(){

	LQueue<int> q;
	q.enqueue(10);
	q.enqueue(20);
	q.enqueue(30);
	//Display the items in the queue that were added.
	while (!q.empty()){
		//Output item on que
		std::cout << q.dequeue() << endl;
	}

	return EXIT_SUCCESS;
}

About

A smple demo showing how to make a queue using linked list.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages