[英]difference between the grow() methods in java.util.Stack and java.util.ArrayDeque
I came across the grow() method for when a stack is full, but when I saw there was a difference in the grow() function in the arraydeque, I wondered what the difference actually was.当堆栈已满时,我遇到了 grow() 方法,但是当我看到 arraydeque 中的 grow() function 存在差异时,我想知道实际差异是什么。
Does anyone know the answer to this?有谁知道这个问题的答案?
if (s == elementData.length){
elementData = this.grow()
}
So eventually I found out that the differences are the following:所以最终我发现差异如下:
Stack growable:堆栈可增长:
Arraydeque growable: Arraydeque 可增长:
'Array deques have no capacity restrictions and they grow as necessary to support usage.' “数组双端队列没有容量限制,它们会根据需要增长以支持使用。” arraydeque
数组队列
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.