stack tag

23 questions


1 answers
276 views
0
Reverse Output to Python Stack

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...

1 years ago

1 answers
64 views
0
Understanding Stack Structure in c++

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 ...

1 years ago

1 answers
73 views
0
Understanding Stack Overflow

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...

1 years ago

1 answers
131 views
0
Why can't I use alloca()?

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...


1 answers
63 views
0
Is C assigned a stack for every {}?

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...

1 years ago

1 answers
83 views
0
c Language stack string backwards output question

#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...

1 years ago

1 answers
93 views
0
It's the calculation code for the four-day operation using Java generic stack, but the nullPointerException error keeps popping up

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(...

1 years ago

1 answers
67 views
0
c Language // free function related question.

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...

1 years ago

1 answers
118 views
0
Stack-related questions

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>#...

1 years ago

1 answers
122 views
0
I have a question about the c++ pointer!

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 years ago
- 1 - »

© 2024 OneMinuteCode. All rights reserved.