+ 1
Im totally lost on what to do for this (enqueue) contructoin method and need some examples to push me in the right direction.
public void enqueue(E target) { /** TODO if queue is full, expand capacity the array-based data collection, * for example, doubling its size and copying the original data items into the new expanded array. * Then insert a new data item with reference to the input target into the queue * Do not forget to change the size **/ }
3 odpowiedzi
+ 8
I guess the tags are misleading.
Correct me if I am wrong but you are looking for a "Java code example on doubling array size for a queue if it's full."
I say Java because void return type syntax is not supported in JavaScript and NetBeans is a popular IDE for Java development for Desktop applications.
If yes then using tags like 'java' , 'queue' & 'array' can help Java programmers see your problem easily.
+ 2
I wish I could help, did you find a solution?
+ 2
If I understand your question correctly, I think this link might help.
https://www.tutorialspoint.com/how-to-resize-an-array-in-java