I'm trying to write a Java method to preform a "multi-pop" off a stack.
It should perform a "pop" operation on a stack
object k
number of times. This is what I'm thinking, but it's not quite right. Any help out there?
public void multipop(int k) {
while (top != null) {
for (int i = 0; i <= k; i++) {
this.pop();
}
}
}