Skip to main content
Filter by
Sorted by
Tagged with
0 votes
2 answers
75 views

I am looking to programmatically apply a typically infixed operation (eg: +, -, *, /) on two integers, where the operation is specified via a string. I have had success accessing the method itself ...
MolarFox's user avatar
0 votes
1 answer
136 views

I need to implement an expression evaluator with some custom types, it is easy to evaluate expressions with only numbers or variables with the help of postfix (or prefix) notation but how to extend ...
srilakshmikanthanp's user avatar
1 vote
1 answer
67 views

Below is the code for infix to prefix conversion. My code works fine until the use of reverse function where it does not print any string after copying. I have tried using a for loop to copy the ...
SWAPNIL SRIVASTAVA's user avatar
0 votes
1 answer
645 views

Note:- I'm not talking about Increment & Decrement Operator. I'm talking about prefix & postfix expressions. Example in python:- def calculate(a, b, c, d): return a * ( b + c ) / d ...
Frank David's user avatar
0 votes
1 answer
248 views

This is my first question so pardon for non technical language I am making a program to convert infix to prefix and postfix. I made infix to postfix which is working. Now when I want to infix to ...
Parnaval's user avatar
0 votes
0 answers
132 views

I have propositional and temporal logic expressions like: "phi1 => phi2"; "phi1 U phi2"; "X phi1". I would like to represent them using prefix notation, i.e, "...
user849172's user avatar
0 votes
1 answer
165 views

Working a evaluator for Polish Notation and I was adding a way to distinguish if the string I got was a number or not using the isNaN function. This works fine, until you add + + to the string. ...
4156's user avatar
  • 410
0 votes
2 answers
699 views

A stack is said to be the ideal data structure for Arithmetic Evaluation. Why is it so? Why do we even need a data structure for Arithmetic Evaluation? I've been studying about this for some time now ...
slayk's user avatar
  • 17
0 votes
1 answer
396 views

I am writing an evaluation code for polish notation. When I overcome ClassCastException I get EmptyStack and when I solve Emptystack I get ClassCast I'm in a loop. Here is how I wanted to evaluate the ...
Selçuk Başaran's user avatar
1 vote
1 answer
291 views

I need to compare a given logical expression with another in java, to identify if both are the same. For example, consider an expression as ((a&b)&(c|d)&(e&f)) and other as ((a&e)&...
user7630232's user avatar
0 votes
0 answers
245 views

Here I am converting an infix expression to a prefix expression. For some test cases my result is perfect. But for certain test cases I get an output which is correct according to some sites but ...
Umang 's user avatar
  • 139
0 votes
2 answers
111 views

I am wondering if I could write, for instance: <<(object, cout); or <<(cout,object); where object is a user defined class which has the << operator overloaded, just as one could ...
M.Ionut's user avatar
  • 187
5 votes
4 answers
2k views

I am working on a Kattis problem, where I am supposed to take the input in prefix notation, simplify it and return it in prefix notation as well. These are the examples of inputs and outputs: Sample ...
Leff's user avatar
  • 1,610
-2 votes
1 answer
542 views

Please help me in JavaScript: The program that I am coding is one that takes in an expression in prefix notation and outputs the same expression in infix notation. The idea behind this program is as ...
Faiq Ashraf's user avatar
0 votes
1 answer
3k views

I'm writing code to convert Infix expression into Postfix and Prefix at the same time. My problem is I haven't been able to convert into the prefix expression. In my intoprefix() I tried everything, ...
Christian Caranoo's user avatar
0 votes
1 answer
105 views

/^a-bc+d*ef I am little bit confused about this expression *ef=(e*f) +d*ef=d+(e*f) -BC=(b-c) /^a? if it is ^23= 2^3 here I am confused, what should I do? please need help. /^a-bc+d*ef /^a-bc+d(...
Bilal's user avatar
  • 21
3 votes
3 answers
1k views

Why does that code does not compile due to an error: #include <iostream> using namespace std; int main() { int i = 0; cout << ++(i++) << " " << i << endl; ...
Yaroslav's user avatar
  • 1,385
0 votes
1 answer
2k views

My problem is I don't know how to get anything to output from here. I want to print the postfix result so far using printResult().. how can I do this? I am not sure how to cout the result I am ...
mikeboss21's user avatar
0 votes
0 answers
2k views

I am really stuck in make conversion of special prefix to postfix operation on our task, let me describe the task similarly : We have such operation to use as operations in our prefixes, here is the ...
Hayra's user avatar
  • 466
2 votes
2 answers
3k views

I need algorithms that will check whether given expression is infix, postfix or prefix expression. I have tried a method by checking first or last 2 terms of the string e.g. +AB if there is an ...
Ahsan's user avatar
  • 422
2 votes
1 answer
295 views

I am trying to solve the coin-change problem: Given a list of number , k , how many ways are there to give change to a given amount m. As one of the resource I have the following pseudo code: (...
Bula's user avatar
  • 2,842
4 votes
4 answers
11k views

I am writing a small calculator (with prefix notation) and I'm curious how I'd convert prefix notation to infix notation. I currently have a function, but it's being weird, and I'm not sure how to fix ...
tekknolagi's user avatar
  • 11.1k