Questions tagged as 'stack'

1
answer

What happens to RAM if a key is pressed on the computer for a long time?

What happens to RAM if a key is pressed on the computer for too long? Example: computer has been turned on and a key is pressed these bytes are being read by the processor and written in memory, right?     
asked by 29.11.2018 / 09:04
2
answers

Why does not the battery pop?

With this code, the book tells me that this does not pop the stack, but why exactly does it not bang? #include <stdio.h> int main(){ int *p; while(1){ p = new int; } }     
asked by 18.07.2017 / 22:38
1
answer

Pointer pointer to change my stack. Why should I use them?

I'm doing a code that consists of parsing an arithmetic expression, and checking if when I open a '(', then I should close a ')'. That is, check whether the expression is valid or not. For this I implemented a stack to help me solve this problem...
asked by 13.07.2017 / 06:02
1
answer

Is there a standard "stack" data structure in Python?

If not, do you know a good non-standard module? I would need to work with stack , but I find it very strange that there is no standard stack (stack) module in Python and at the same time there is a queue (queue) module.     
asked by 25.11.2014 / 21:12
1
answer

Vector reading in C is wrong

struct cadastro{ int codigo; char nome[200]; char cpf[11]; char rg[10]; char tel[12]; char end[100]; }cadastro;//struct do tipo cadastro. struct cadastro cd[max];//vetor da funcao cadastro de cliente I have set up a menu, with do - while...
asked by 09.05.2016 / 00:08
1
answer

Stack / Stack with priority in C #?

My teacher passed 2 exercises, the first was to create a simple stack ( Stack ) to run unit tests in this class: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threa...
asked by 06.09.2017 / 07:05
1
answer

Dynamic Stack - C

I'm studying dynamic stack from the code below: #include <stdio.h> #include <stdlib.h> #define tam 50 // ---- Estruturas para os tipos ------------------------------------------------------------------------------- typedef struct...
asked by 17.09.2018 / 23:19
2
answers

Resize in dynamic pointer transforms dimension into garbage

I was responding to a std :: stack implementation problem. It was easy, but I could not use my first idea: std :: vector (it replaced forever the dynamic pointers). My code is: template <class T> class stack { T* data; unsigned s...
asked by 20.04.2014 / 21:41
1
answer

Handling batteries in C

I am a beginner in C and have the following exercise:    The Park Parking Here contains a single lane that holds up to   ten cars. There is only one entrance / exit in the parking lot,   end of the mall. If a customer arrives to pick up a car...
asked by 04.09.2015 / 19:16
1
answer

How does the "pop ()" function work on a stack?

I would like to understand how pop works in stacks. I just put the part that I did not understand, I know that in the pop() function there is also the empty check, but I only put the part that I did not understand. It turns o...
asked by 31.08.2018 / 20:47