23 questions
We're using Python stack to produce reverse outputqwert -> trewqb=input(Please enter:)text=list(b)a=[]def push():a.append(text[-1])def pop():text.remove(text[-1])for i in text: if len(i) != 0: push...
When I tried to implement reverse Poland, after receiving input in while(scanf(%s,s)!=EOF), the conditional branch begins in if(s[0]=='+'). Why do I keep the index of s[0] and array 0 fixed?I imagine ...
I think the stack will pile up from the larger memory address to the smaller memory address, but if it overflows, will the memory on the other side of the stack be rewritten?Or will the stack be rewri...
As far as I know, alloca() dynamically allocates memory in stack, not heap, and releases memory on its own when it returns from routine Then shouldn't it be recommended because it's safer because it d...
void foo() { int c[100]; { int d[200]; } //d[0]=1; //Error return;}It's not a situation like if or for, it's just another {}As I left the block, I couldn't write d.The professor said {} is a block in...
#include < stdio.h>#include < stdlib.h>#include < string.h>typedef char element; typedef struct stackNode { element data; struct stackNode *link; }stackNode;stackNode* top; void pus...
It's a code that uses generic stacksI keep getting a nullpointerception error like that.Below is the full code. } import java.util.*;class GStack<T> {static int top;Object [] stck;public GStack(...
I'm implementing the stack as an array, but in the code below,After copying in the main function, delivering the copied stack If free is used, a compilation error does not appear, but if you run it, f...
When I run the Stop function, I need to show the last data that went in, but it doesn't come outDo you know what the problem is?#include<stdio.h>#include<stdlib.h>#include<string.h>#...
Hello.I got curious while implementing the stack with a linked list.I implemented to release the memory of the node that has data that will be pop when pop operation is performed. Does the pointer of ...
- 1 - | » |
© 2024 OneMinuteCode. All rights reserved.