In my eclipse, whenever i tried to used Dynamic Queue ide always throws a error that DynamicQueue cannot be resolved to a type
I am not able to use Dynamic Queue Properly
package Queue;
import java.util.Queue;
public class ReverseQueue {
public static void main(String[] args) {
// TODO Auto-generated method stub
DynamicQueue queue = new DynamicQueue(6);
for (int i = 1; i <= 6; i++) {
queue.enqueue(i * 10);
}
queue.display();
ReversedQueue(queue);
queue.display();
}
public static void ReverseQueue(DynamicQueue queue) {
if (queue.isEmpty()) {
return;
}
int element = queue.dequeue;
ReverseQueue(queue);
queue.enqueue(element);
}
}
is this correct or not? i send a simple code in which DynamicQueue is used.
@jaykulkarni17ab_6f3394949782b604 There is no inbuilt DynamicQueue class in java … So you have to make a DynamicQueue on your own. And that is why you’re getting DynamicQueue cannot be resolved to a type error.Refer this article to know how to implement the class :
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.