stack tag

23 questions


1 answers
285 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...

2 years ago

1 answers
76 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 ...

2 years ago

1 answers
84 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...

2 years ago

1 answers
152 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
78 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...

2 years ago

1 answers
97 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...

2 years ago

1 answers
104 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(...

2 years ago

1 answers
78 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...

2 years ago

1 answers
136 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>#...

2 years ago

1 answers
144 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 ...

2 years ago
- 1 - »

© 2024 OneMinuteCode. All rights reserved.