Questions tagged as 'stack'

1
answer

Invert stack values

I'm trying to invert the order of stack elements using the while loop, but I'm not getting it. pilha* inverte(pilha **p) { pilha *outra = cria(); //aloca e seta a qnt com 0 while(vazia(&p)) { outra->dados[outra-&...
asked by 13.12.2016 / 22:17
1
answer

Stack Frame - Example

I am developing a program to simulate a Stack, however I have some difficulties in understanding the operation, can you correct this example? main(int y) { int j; f(j+1); } f(int x) { int i; return i+1; } I made this scheme, so w...
asked by 21.06.2014 / 13:41
0
answers

Error converting an infix expression to fixed post

Hello, I personally need to read an infix expression and convert it to postfix. I've reviewed the code several times but I can not find the error. When I pass an expression for example: a + b, it returns me ab. I needed to return ab +. I t...
asked by 24.10.2018 / 23:25
1
answer

Casting Error

I have a program that works with the Polish inverse notation, which is, when we have an operation ((2 + 3) 8), in Polish notation stands "23 + 8". I have already been able to pass the operation to the Polish notation, however, I am not able to...
asked by 02.10.2018 / 23:43
1
answer

Factoring Press using Stack

I made a vector stack, with the basic functions (push, pop, peek) and with it I want to do a prime factorization of a value. I did the program, but when I compile it, it stays in an infinite loop that I'm not identifying and does not return anyt...
asked by 01.10.2018 / 00:12
1
answer

Invert Dynamic Stack

Can anyone help me with this stack? The purpose is to create a function that invert the values of the stack, I tried to do this use the Invert () function of the code below, but it is not working, when I execute it simply closes the code. If any...
asked by 20.09.2018 / 04:07
0
answers

Dynamic memory hosting [duplicate]

In the book I'm reading something like:    ... the compiler provides somewhere in memory a hosting space for that object, either in the memory space reserved for   local variables (stack), either in the memory space reserved for   data, eit...
asked by 14.08.2018 / 14:39
0
answers

Infix to Postfix conversion - C-STACK

Code that should receive an arithmetic expression in infix (common) notation for postfix notation (Polish reverse). For example, when receiving (A + B C) it should print ABC +. The problem with my code is that when it receives "(A + B C)" it...
asked by 02.05.2018 / 05:13
1
answer

How to get Thread Stack?

I'm trying to create a program to get the thread stack, just like the image, does anyone have any way to get it?     
asked by 20.04.2018 / 00:55
1
answer

How to insert a string into the data stack

I need to make a stack that does a push, pop and print. So I created the functions and this works. But I wanted to add a String to my stack. Possibly a number and time or just a string. But I can not get either. Could someone help me, please?...
asked by 22.03.2018 / 03:28