Linked Questions

0 votes
1 answer
581 views

I need to perform arithmetic operations using the elements in a list. For example, if I have a list of elements [25, +, 5, -, 8, /, 4] how can I convert this as an arithmetic operation in the form 25+...
Nikhil_being_honest's user avatar
0 votes
2 answers
117 views

I have a math expression stored as a String: String math = "12+3=15"; I want to separate the string into the following: int num1 (The first number, 12) int num2 (The second number, 3) String ...
user2939293's user avatar
0 votes
0 answers
77 views

Say I'm given an expression like (1/2) + (3/4) + (5/8) + (2/10) + (3/2) + (10/1) How might I go about computing this expression as a float value in such a way that if the expression where to change ...
user2522420's user avatar
1 vote
0 answers
24 views

Abstract We are creating an application where a user creates a formula with data sent in by labs. I am currently creating a heavily parsed string to determine if the numbers are variables, ...
Christian4423's user avatar
93 votes
4 answers
88k views

I'm writing a small interpreter for a simple BASIC like language as an exercise on an AVR microcontroller in C using the avr-gcc toolchain. If I were writing this to run on my Linux box, I could use ...
Johan's user avatar
  • 3,210
17 votes
14 answers
110k views

I am preparing for an exam where i couldn't understand the convertion of infix notation to polish notation for the below expression: (a–b)/c*(d + e – f / g) Can any one tell step by step how the ...
kar's user avatar
  • 219
2 votes
2 answers
21k views

I have to create an arithmetic evaluator in Java. To do this I have to parse an algebric expression in binary tree and then calculate and return the result. So for the first step how can I parse an ...
Anila's user avatar
  • 1,136
8 votes
5 answers
8k views

Write a program for finding duplicate parenthesis in a expression. For example : (( a + b ) + (( c + d ))) = a + b + c + d (( a + b ) * (( c + d ))) = (a + b) * (c + d) One approach that I am aware ...
OneMoreError's user avatar
  • 7,758
-1 votes
3 answers
8k views

I have a mathematical expression in the form of a String. String exp = "3 + 6 - 10 + 12 + 15"; Now how to calculate the result of this expression as we do with other mathematical expressions. Help ...
Giang Hoàng's user avatar
4 votes
1 answer
3k views

Inorder traversal of a Binary Search Tree yields nodes in increasing order. But what advantages do pre order and post order traversals have on any binary tree? EDIT:What I mean by advantages is : "...
Nikunj Banka's user avatar
  • 11.5k
3 votes
3 answers
1k views

I'm trying to split a simple mathematics expression from it's parenthesis For example : (8+(3(2+3)(4-1))) to separate in to little expressions like (2+3), (4-1), (3*5*3), and finally (8+45). I tried ...
Grainier's user avatar
  • 1,654
0 votes
3 answers
2k views

I have a program where the user inputs 6 doubles, and the program outputs every combination of operators that can go in-between the doubles as 1024 separate strings. Here are the first two results if ...
user1547052's user avatar
2 votes
2 answers
2k views

How do I go about evaluating logical expression like "VERB1 OR (VERB2 AND VERB3) OR (VERB4)" entered at runtime. VERB* are placeholder to evaluate certain conditions. For example, VERB1 might mean ...
dsatish's user avatar
  • 1,051
0 votes
1 answer
2k views

I feel like I've tried everything, searched everything I know to search, and I've been working on this for about 6 classes now. I'm trying to make a program that accepts a string input like "6 + 6 -3+...
ananaso's user avatar
  • 167
3 votes
2 answers
852 views

I'm working on a piece of code where I've to split a string into individual parts. The basic logic flow of my code is, the numbers below on the LHS, i.e 1, 2 and 3 are ids of an object. Once I split ...
HardikT's user avatar
  • 751

15 30 50 per page