Question
I am currently learning about Queues in Java, and cannot figure out how to complete this lab, any help is greatly appreciated. IntQueue: import java.util.ArrayList;
I am currently learning about Queues in Java, and cannot figure out how to complete this lab, any help is greatly appreciated.
IntQueue:
import java.util.ArrayList; import static java.lang.System.*; public class IntQueue { //pick your storage for the queue //you can use the an array or an ArrayList //option 1 private int[] rayOfInts; private int numInts; //option 2 private ArrayList
IntQueueRunner:
import java.util.ArrayList; import static java.lang.System.*; public class IntQueueRunner { public static void main ( String[] args ) { IntQueue test = new IntQueue(); test.add(5); test.add(7); test.add(9); System.out.println(test); System.out.println(test.isEmpty()); System.out.println(test.remove()); System.out.println(test.peek()); System.out.println(test.remove()); System.out.println(test.remove()); System.out.println(test.isEmpty()); System.out.println(test); } }
A+ Computer Science MAKE A QUEUE Lab Goal: This lab was designed to teach you more about queues. Lab Description : You are to create a queue from scratch using either an array or an ArrayList as the storage for the queue. Starting Class : class IntQueue { //pick your storage for the queue //you can use the an array or an ArrayList Files Needed :: IntQueue.java IntQueueRunner.java 1/option 1 private int[] rayofInts; private int numInts; 1/option 2 private ArrayListStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started