从队列转换到ArrayList [英] Convert from Queue to ArrayList
本文介绍了从队列转换到ArrayList的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想将包含数字和运算符的队列更改为ArrayList。
我用Java编码。
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, /, *, +]
我希望这样做,因此我可以使用RPN来计算计算结果。
I wish to do this mainly so i can use RPN to calculate the result of the calculation.
推荐答案
这样做
List list = new ArrayList(outputQueue);
这篇关于从队列转换到ArrayList的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文