Linked List and Queue using Linked computer science homework help

journalism and news organizations communications homework help
March 12, 2023
Criminal Justice law homework help
March 12, 2023

Linked List and Queue using Linked computer science homework help

Lab work

We have seen in class how to model and implement a queue dynamically using a Linked List in a composition relation.

Implement the class Queue that uses Linked List as an inheritance relation.

Note: You have as attachment the code of the Linked List and Queue using Linked List as composition. You just need to modify it.

use this:

#ifndef QUEUE_H
#define QUEUE_H
#include “LinkedList.h”
#include <stdexcept>
using namespace std;

template<typename T>
class Queue
{
public:
Queue();
void enqueue(T element);
T dequeue() throw (runtime_error);
int getSize();

private:
LinkedList<T> list;
};

template<typename T>
Queue<T>::Queue()
{
}

template<typename T>
void Queue<T>::enqueue(T element)
{
list.addLast(element);
}

template<typename T>
T Queue<T>::dequeue() throw (runtime_error)
{
return list.removeFirst();
}

template<typename T>
int Queue<T>::getSize()
{
return list.getSize();
}

#endif

 
Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount!
Use Discount Code "Newclient" for a 15% Discount!

NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.

Buy Custom Nursing Papers