← Back to Data Structures & Algorithms
Question 417
Enqueue Into an Array Queue
Enqueue Into an Array Queue
ShiftQueue stores its values in a plain array and always keeps the front at index 0. Every method except enqueue is already written.
Requirements:
1. Complete enqueue(int value) so it returns false when the queue is already full.
2. Otherwise store the value at index size, increase size, and return true.
Do NOT write a main method.Expected Output:
true true true Queue: 10 20 30 3
= newline. The output ends with a newline — print one after the last line.
Hints4 available
Sign in to use hintsTopics:
Data Structures & AlgorithmsQueues
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (sysout, psvm, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.