当前位置: 代码迷 >> 综合 >> 算法 1.3.41 | 1.3.42 复制栈 复制队列
  详细解决方案

算法 1.3.41 | 1.3.42 复制栈 复制队列

热度:106   发布时间:2023-09-23 03:38:46.0
	public Stack(Stack<Item> that){Stack<Item> temp = new Stack<Item>();for(Item i:that){temp.push(i);}for(Item i:temp){push(i);}}


public Queue(Queue<Item> that){for(Item i:that)enqueue(i);
}


  相关解决方案