FAQ Database Discussion Community

Javascript pushing operators to a stack from a string

I am currently writing a program in Javascript where the user enters in an infix notation expression as a string which will then be converted to postfix notation. I'm having trouble pushing each operator to the stack. Below are the two main portions of code pertinent to my question. var...

Creating a postfix calculator in C++?

I have an assignment where I need to create a postfix calculator. I'm running into some difficulties that previous questions regarding the subject on SO didn't cover adequately. Here's an example of input I want to handle: 12 6 + 2 * [Carriage return] Result: 36 The description of the...

postfix calculator having trouble with segfaults

i'm trying to create a postfix calculator using linked-list. when i compile, it doesn't show any errors but when it's executed it would show Segmentation Fault. i don't know how to deal with this, please help. here's my code: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> typedef struct node...

Does Scala provide an easy way to convert Infix expressions to postfix ones?

I a beginner in Scala and I am writing a program in Scala to convert infix arithmetic expression to the postfix one meanwhile wondering whether Scala provided an easier way to handle these kind of conversions. Can anyone guide me if there is any easier way for it?