Sudhir sharma has Published 1149 Articles

Evaluation order of operands in C++

sudhir sharma

sudhir sharma

Updated on 22-Jan-2021 13:16:32

235 Views

There are some rules in programming that govern how an operation is performed.The order of evaluation of operation and the associativity of operations (which is left to right is defined).Here is a program to show the evaluation order of operands, ExampleLive Demo#include using namespace std; int x = 2; ... Read More

Even-odd turn game with two integers in C++

sudhir sharma

sudhir sharma

Updated on 22-Jan-2021 13:16:29

272 Views

In this problem, we are given three integer values A , B and T. Our task is to create a program to play Even-odd turn game with two integers. The two integer value are :T, that denotes the number of turns in the game.A denotes the value for player1B denotes the ... Read More

Even numbers at even index and odd numbers at odd index in C++

sudhir sharma

sudhir sharma

Updated on 22-Jan-2021 13:16:18

1K+ Views

In this problem, we are given an array arr[] of size n consisting of n/2 even values and n/2 odd values. Our task is to create a program to place even numbers at even index and odd numbers at odd index. Let’s take an example to understand the problem, Input: arr[] = ... Read More

Even size subtree in n-ary tree in C++

sudhir sharma

sudhir sharma

Updated on 22-Jan-2021 13:15:47

186 Views

In this problem, we are given an adjacency list that denotes an n-ary tree. Our task is to find the number of even size subtree in n-ary tree. N-ary tree is defined as a collection of nodes normally represented hierarchically in the following manner.The tree is started at the root node.Each node ... Read More

Evaluate an array expression with numbers, + and - in C++

sudhir sharma

sudhir sharma

Updated on 22-Jan-2021 13:13:55

285 Views

In this problem, we are given an array arr[] consisting of n character values denoting an expression. Our task is to evaluate an array expression with numbers, + and –. The expression consists of only, numbers, ‘+’ character and ‘- ’ character.Let’s take an example to understand the problem, Input: arr = ... Read More

Evaluation of Prefix Expressions in C++

sudhir sharma

sudhir sharma

Updated on 22-Jan-2021 13:13:40

16K+ Views

In this article, we will discuss the evaluation of prefix Expression. Prefix ExpressionIn this notation, operator is prefixed to operands, i.e. operator is written ahead of operands. For example, +ab. This is equivalent to its infix notation a + b. Prefix notation is also known as Polish Notation.For more read.Example:* + ... Read More

Evaluation of Expression Tree in C++

sudhir sharma

sudhir sharma

Updated on 22-Jan-2021 13:13:21

1K+ Views

In this problem, we are given an expression tree that consist of binary operations like +, - , /, *. We need to do the evaluation of the expression tree and then return the result.Expression Tree is a special type of binary tree in which each node either consist of an ... Read More

Euler's Four Square Identity in C++

sudhir sharma

sudhir sharma

Updated on 22-Jan-2021 13:07:49

208 Views

In this problem, we are given two numbers and we need to find the product of the numbers using Euler's four square Identity. Euler’s Four Square Identity is the method to find the product of two numbers which can be represented using the sum of four squares of the number if the numbers can ... Read More

Eulerian Number in C++

sudhir sharma

sudhir sharma

Updated on 22-Jan-2021 13:07:32

498 Views

In mathematics, the Eulerian number is a special type of combination number. It defines the number of permutations in which the next element is a specific number greater than the previous one.Denoted as,  A(n, m) is permutation from 1 to n in which two numbers vary by m.Problem Statement: In this problem, we ... Read More

Evaluate a boolean expression represented as string in C++

sudhir sharma

sudhir sharma

Updated on 22-Jan-2021 13:07:18

707 Views

In this problem, we are given a string exp that represents a boolean expression. Our task is to evaluate the boolean expression represented as String.The valid characters in the expression are −0 or 1 denoting the boolean value& denoting AND operation| denoting OR operation^ denoting XOR operationWe need to solve ... Read More

Advertisements