QUESTION 1:
Queue Class: Write a Queue class using doubly-linked structure and implement the following functionalities.
enqueue (inserts element to the end)
dequeue (removes the front element and provides content)
isEmpty (checks whether the Queue is empty or not)
makeEmpty ()
peek (provides the element sitting at the top/front, but does not remove)
print (prints all the elements from front to the end)
reversePrint(prints all the elements from end to the front with the help of back pointers inside your nodes)
Here is the image of the code attached , written by me in c++ in sublime editor.
Each functions are named as mentioned in the problem.




Hope the solution will be helpful for you :-)
QUESTION 1: Queue Class: Write a Queue class using doubly-linked structure and implement the following functionalities....
Write a C++ program to implement Queue ADT using singly linked structure. The program includes the following: Define the Queue class template in the header file QueueLinked.h. // QueueLinked.h #ifndef QUEUE_H #define QUEUE_H #include <iostream> using namespace std; template <typename T> class Queue { public: // Constructor Queue(); //Desctructor ~Queue(); // Makes the queue to the empty state. void make_empty(); // Checks if the queue is empty. bool empty() const; // Inserts item at the end of the queue. void...
Write a C++ program to implement a queue using linked lists. You can use the queue data structure from the Standard Template Library (STL). The program should provide the following functionality: Enqueue data into queue Dequeue data from queue Print data at the front Print data at the back Print the entire queue Check if the queue is empty Print the number of elements in the queue Test your program using at least the following test cases (considering the queue...
You need to implement a queue based on the doubly linked list. (In C++) **PLEASE follow the format** **Don't worry about the readme.txt** THANK YOU SO SO MUCH! You have to implement the doubly linked list in DList.h and DList.cpp and the queue in the LinkedQueue.h and LinkedQueue.cpp; all as template classes. You have to provide the main.cpp file as we discussed in class to allow the user to interact with your queue using enqueue, dequeue, front, back, size, empty,...
Collect/finish the Java code (interface and the complete working
classes) from lecture slides for the for the following ADT:
3) Queue ADT that uses an array internally (call it AQueue)
Make sure you keep the same method names as in the slides
(automatic testing will be performed)! Make sure your classes
implement the corresponding interfaces. Put your classes in a
package called cse11. Try to make the code robust and try to use
generics.
The Queue ADT The Queue ADT...
In Java, create a program implementing the functionalities of a standard queue in a class called Queue3503. You will test the functionalities of the Queue3503 class from the main() method of the Main class. In a queue, first inserted items are removed first and the last items are removed at the end (imagine a line to buy tickets at a ticket counter). Do NOT change your class name from "Main". The Main class should come first in your code. Your filename should be "Main.java". The Queue3503 class will contain:...
Create a Java code that includes all the methods from the
Lecture slides following the ADTs
LECTURE SLIDES
Collect/finish the Java code (interface and the complete working classes) from lecture slides for the following ADTS: 4) Queue ADT that uses a linked list internally (call it LQueue) Make sure you keep the same method names as in the slides (automatic testing will be performed)! For each method you develop, add comments and estimate the big-O running time of its algorithm....
e. public class Queue { // Uses the correct Stack class from ME2
Ex 19 private Stack mStack; public Queue() { setStack(new Stack());
} public Queue enqueue(E pData) { getStack().push(pData); return
this; } public E dequeue() { return getStack().pop(); } public E
peek() { return getStack.peek(); } private Stack getStack() {
return mStack; } private void setStack(Stack pStack) { mStack =
pStack; } }
f. public class Queue extends Stack { // Uses the correct Stack
class from ME2 Ex...
Create a CircularArrayQueue<E> implementation of the Queue<E> interface defined in class. Hints: You will need two index variables to keep track of the start and the end of the queue. Consider the queue to be empty when the front/back index pointers are equal (which means that the 'back' pointer will always be pointing at the next place to add an item). Be careful of index increments and decrements; make sure you perform the operations necessary to make the pointers loop...
create a class named IntegerQueue given a singlylinkedqueue of integers, write the following methods: max(SinglyLinkedQueue<Integer> s) to return the max element in the queu. min(SinglyLinkedQueue<Integer> s) to return the min element in the queue. sum(SinglyLInkedQueue<Integer> s) to return the sum of elements in the queu. median(SinglyLinkedQueue<Integer> s) to return the median of elements in the queue. split(SinglyLinkedQueue<Integer> s) to separate the SinglyLinkedQueue into two ArrayQueues based on whether the element values are even or odd. package Stack_and_Queue; import java.util.Iterator; import...
Study the "Queue as linked list simple example" posted in this module. Rewrite the code to use array instead of linked lists. Please do not change anything besides the data structure. Instead of linked list use an array. The functionality should remain exactly the same. LListQueue.cpp ///--------------------------------------------------------------- /// File: LListQueue.cpp /// Purpose: Implementation file for a demonstration of a queue /// implemented as an array. Data type: Character /// Programming Language: C++ ///--------------------------------------------------------------- #include "LListQueue.h" ///-------------------------------------------- /// Function: LListQueue() ///...