Question
JAVA I need an expert to edit on the code to make it works on online compiler and solve what inside the main in the
JAVA
I need an expert to edit on the code to make it works on online compiler and solve what inside the main in the comment:
interface MyQueue
public T dequeue();
public T first(); public boolean isEmpty(); public int size();
public String toString();
} class MyLinkedListQueue
public T first() { if (isEmpty()) return null; return list.first().getElement(); } public boolean isEmpty() { if (list.size()==0) return true; return false; }
public int size() { return list.size(); }
public String toString() { return "Queue"; }
} public class Main { public static void main(String[] args) { MyQueue
queue.enqueue(34); queue.enqueue(56); queue.enqueue(12); queue.enqueue(8); queue.enqueue(44); queue.enqueue(12); queue.enqueue(45);
// a) Now dequeue the queue 3 times // b) Now insert 72 in the queue
//show the whole queue }
} }
Step 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