“stack.pop ()” Code-Antworten

stack.pop ()

stack = [[0,1], [4,2], [5,3], [8,4]]
print(stack.pop()[1])
#4
print(stack)
#[[0, 1], [4, 2], [5, 3]]
Wrong Wombat

Stack Pop

int pop() {
   int data;
	
   if(!isempty()) {
      data = stack[top];
      top = top - 1;   
      return data;
   } else {
      printf("Could not retrieve data, Stack is empty.\n");
   }
}
Evil Shiroe

Ähnliche Antworten wie “stack.pop ()”

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen