Category: optimization
I have asked a question on stackoverflow: inline int test(int n, int tag, int flag) { if (0 == flag) return ((n & tag) == tag); return ((n & …
September 5, 2014
algorithms, beginner, c / c++, code, code library, math, optimization, programming languages, recursive, tricks
We all know the formula to compute value e (mathematical constant that is the base of the natural logarithm) is e = 1 + 1/1!+ 1/2!+ .....+ 1/n! Now, …
The Dynamic Programming DP is one of the most-used approach to solve problems that satisfy the overlapping sub-problems and the optimal substructures. The simplest example is to compute Fibonacci …
Remember a couple days ago, I write a solution to this puzzle using Dynamic Programming (DP)? The DP solution helps to avoid duplicate computation in the sub-problems (smaller size). …
Question: Given an integer (maximum 100), compute the number of distinct ways to split the number using non-negative integer numbers. For example, given 5, there are 7 ways to …