Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Implement Class IntQueue, a class that contains a queue of integers using an Array. the members are as follows: Attributes 1)Data structure 2) Variable to

Implement Class IntQueue, a class that contains a queue of integers using an Array.

the members are as follows:

Attributes
1)Data structure 

2) Variable to keep where we are (the index to insert and remove the next value)

Methods

1)boolean isEmpty()

2)int dequeue();

3)void enqueue(int x);

4) bool isFull()

Third, using stack and queue classes in everyday problems 

Task 2 - Let Q be a non-empty queue, and let S be an empty stack. Using only the stack and queue Abstract data type methods and a single element variable X, write an algorithm to reverse the order of the elements in Q. The result would be that Q has the same elements but in reverse order.

Note: You can use the Stack and Queue implementation classes implemented in previous tasks or Java Collections Stack and Queue classes. 

Task 3  Design a method that converts an input integer N into a link list of its digits. The link list would start with the least significant digit up until the most significant digit. You may use the LinkedList class in JCF (Java collection framework). 

Example: if the input was 2349, the link list would look like this  (head) 9->4->3->2

Task 4) write a Test class to test your previous CASES

Step by Step Solution

There are 3 Steps involved in it

Step: 1

Sure heres an implementation of the IntQueue class in Java followed by the solutions to the tasks yo... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Structures And Algorithms In C++

Authors: Michael T. Goodrich, Roberto Tamassia, David M. Mount

2nd Edition

978-0470383278, 0470383275

More Books

Students also viewed these Algorithms questions

Question

Discuss some of the major benefits to be gained from budgeting.

Answered: 1 week ago

Question

Express the following ratios in its lowest terms.

Answered: 1 week ago