Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert from Queue to ArrayList [duplicate]

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 :)

like image 830
user3120023 Avatar asked Dec 20 '13 16:12

user3120023


1 Answers

ArrayList list = new ArrayList(outputQueue);
like image 165
thatidiotguy Avatar answered Oct 04 '22 08:10

thatidiotguy