chaitu.jil
BAN USERpublic static int multiply(int x, int y) {
return ((x & 1) > 0 ? y : 0) + ((x & ~1) > 0 ? multiply(x >> 1, y << 1) : 0);
}
input is just number of fibonacci s to add. Solution must be recursive. This solution works but is confusing
- chaitu.jil October 01, 2014public static int fibonacciSum(int number) {
int sum = 1;
if (number <= 1) {
return 0;
} else if (number == 2) {
return 1;
} else {
sum += fibonacciSum(number - 1) + fibonacciSum(number - 2);
}
return sum;
}
1. redundancy - You don't want to save duplicate data in the same rack to make sure it is available when one of the different racks go down
2. Network bandwidth - You want nodes to be as close as possible for a better network bandwidth
- chaitu.jil October 01, 2014