Then You must not have changed the type params or didn't import LinkList
Stack<Integer> pNum = new Stack<Integer>();
LinkedList<Integer> link = new LinkedList<Integer>(pNum);
Is perfectly...
Type: Posts; User: hackthisred
Then You must not have changed the type params or didn't import LinkList
Stack<Integer> pNum = new Stack<Integer>();
LinkedList<Integer> link = new LinkedList<Integer>(pNum);
Is perfectly...
Answer: Try using a LinkedList instead or even convert your Stack to a LinkedList... This gives you the libraries of both Stacks & Queues, Stacks being LIFO, and Queues being FIFO. :confused:
...