New answers tagged

0

For example, the sum of integers from n to m is 0 if n > m, and n plus the sum of integers from n+1 to m otherwise. You can write code for this using tail recursion. If tail recursion is part of the language this will work and be efficient. A C or C++ compiler may optimise this using tail recursion, or it may not. Without tail recursion optimisation, this ...


0

You have instructions that test conditions (often “compare”instructions), and later there are instructions acting on these conditions (usually conditional branch instructions). For example your program contains “if (x > 0) z = v + 1;”. There will be a compare instruction comparing x and 0, and a conditional branch around the “z = v + 1” if the result of ...


Top 50 recent answers are included