I want to change a queue containing numbers and operators into an ArrayList. I am coding in Java.
Currently my Queue is defined as follows:
Queue outputQueue = new LinkedList();
The queue currently contains the following data:
[1, 9, 3, /, 4, 3, -, 2, /, *, +]
I wish to do this mainly so i can use RPN to calculate the result of the calculation.
Is there a way to do this?
Thanks in advance for any help :)
ArrayList list = new ArrayList(outputQueue);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With