Reputation: 11
Stack s=new Stack();
LinkedList qeue = new LinkedList();
public void pushCharacter(char ch) {
s.push(ch);
}
public void enqueueCharacter(char ch) {
qeue.addLast(ch);
}
public char popCharacter() {
s.pop();
return // ?11
}
Upvotes: 1
Views: 38
Reputation: 49636
return s.pop();
Stack#pop
"removes the object at the top of this stack and returns that object as the value of this function". You must have a Stack<Character>
, though. Don't use raw types.
Upvotes: 1