I have a programming assignment that is simulating a queue, such as a waiting room. It is to read a data file (our professor has it and will use it to test) that our program does what it's supposed to. The method I'm currently working on is to split the queue. What it's supposed to do is take the even # nodes and them end up on a 2nd queue while the odd ones end up on the queue they are already on. I will post the code I have so far, its getting me an error with the stack. My idea was to have a temp stack to store the odd ones, and the 2nd queue. I was going to push the odd ones to the temp stack and the even ones to the 2nd queue where they belong. I would then push the odd ones back onto the original queue. It's not liking the initialization of the 2nd queue and stack though.
1st Error is on line that starts with "LinkedQueue<String>" and the error is that the type LinkedQueue<String> is not generic; it can't be parameterized with arguments <String>
2nd Error is on the following line with the LinkedStack and it says that LinkedStack can not be resolved to a type.
public LinkedQueue<String> Split ()) { LinkedQueue<String> cust2 = new LinkedQueue<String>(); LinkedStack<String> temp = new LinkedStack<String>(); int current = 0; int total = size; while (current <= size) { temp.push(remove()); current++; cust2.push(remove()); current++; } while (current != 0) { arrive(temp.pop()); } }