Consider the below program.
C
#include<stdio.h>
int x = 0;
  
int f1()
{
  x = 5;
  return x;
}
  
i...

Share

It is compiler dependent in C. It is never safe to depend on the order of evaluation of side effects. For example, a function call like below may very well behave dif...

Share

Given a string that represents an expression constituting numbers and binary operator +, – and * only. We need to parenthesize the expression in all possible w...

Share

Prerequisite : Minimax Algorithm in Game Theory
As seen in the above article, each leaf node had a value associated with it. We had stored this value in an array. But...

Share

Euler Totient Function (ETF) Φ(n) for an input n is count of numbers in {1, 2, 3, …, n} that are relatively prime to n, i.e., the numbers whose GCD (Gre...

Share

Given a polynomial of the form cnxn + cn-1xn-1 + cn-2xn-2 + … + c1x + c0 and a value of x, find the value of polynomial for a given value of x. Here cn, cn-1,...

Share

Given a simple expression tree, consisting of basic binary operators i.e., + , – ,* and / and some integers, evaluate the expression tree.
Examples:
Input :
R...

Share

Evaluate an expression represented by a String. Expression can contain parentheses, you can assume parentheses are well-matched. For simplicity, you can assume only ...

Share

The Postfix notation is used to represent algebraic expressions. The expressions written in postfix form are evaluated faster compared to infix notation as parenthe...

Share