public class CyclePebblingThing
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
CyclePebblingThing.Row |
Constructor and Description |
---|
CyclePebblingThing(int[] pebbles,
int[] pools) |
Modifier and Type | Method and Description |
---|---|
void |
computeStuff()
Compute the sums and stuff around a cycle.
|
static void |
main(java.lang.String[] args) |
double |
pMinus(int k)
Compute the partial sum from 1 to k-1.
|
int |
power(int base,
int exponent) |
double |
pPlus(int k)
Compute the partial sum from k+1 to n-2.
|
public static void main(java.lang.String[] args)
public void computeStuff()
pebbles
- an array of length n.pools
- an array of length n-1.public double pMinus(int k)
pebbles
- k
- public double pPlus(int k)
pebbles
- k
- public int power(int base, int exponent)