# Tag Archives: expression-evaluation

## Find the minimum value of X for an expression

Given an array arr[]. The task is t find the value of X such that the result of the expression (A – X)^2 + (A… Read More »

## What is an Expression and What are the types of Expressions?

Expression: An expression is a combination of operators, constants and variables. An expression may consist of one or more operands, and zero or more operators… Read More »

## Count the number of currency notes needed

You have an unlimited amount of banknotes worth A and B dollars (A not equals to B). You want to pay a total of S dollars using exactly N notes. The… Read More »

## Building Expression tree from Prefix Expression

Given a character array a[] representing a prefix expression. The task is to build an Expression Tree for the expression and then print the infix… Read More »

## Infix to Postfix using different Precedence Values for In-Stack and Out-Stack

Conversion of infix to postfix expression can be done elegantly using two precedence function. Each operator is assigned a value (larger value means higher precedence)… Read More »

## Arithmetic Expression Evalution

The stack organization is very effective in evaluating arithmetic expressions. Expressions are usually represented in what is known as Infix notation, in which each operator… Read More »

## Infix to Prefix conversion using two stacks

Infix : An expression is called the Infix expression if the operator appears in between the operands in the expression. Simply of the form (operand1… Read More »

## Check for balanced parenthesis without using stack

Given an expression string exp, write a program to examine whether the pairs and the orders of “{“, ”}”, ”(“, ”)”, ”[“, ”]” are correct… Read More »

## Vieta’s Formulas

Vieta’s formula relates the coefficients of polynomial to the sum and product of their roots, as well as the products of the roots taken in… Read More »

## Check for balanced parentheses in an expression | O(1) space

Given a string of length n having parentheses in it, your task is to find whether given string has balanced parentheses or not. Please note… Read More »

## Range Queries for Longest Correct Bracket Subsequence Set | 2

Given a bracket sequence or in other words a string S of length n, consisting of characters ‘(‘ and ‘)’. Find the length of the… Read More »

## Evaluate an array expression with numbers, + and –

Given an array arr[] of string type which consists of strings “+”, “-” and Numbers. Find the sum of the given array. Examples : Input… Read More »

## Solve the Linear Equation of Single Variable

Given a linear equation, task is to find the value of variable used. The equation contains only ‘+’, ‘-‘ operation, the variable and its coefficient.… Read More »

## Print Bracket Number

Given an expression exp of length n consisting of some brackets. The task is to print the bracket numbers when the expression is being parsed.… Read More »

## Smallest expression to represent a number using single digit

Given a number N and a digit D, we have to form an expression or equation that contains only D and that expression evaluates to… Read More »