| Author | Dave Jarvis <email> |
|---|---|
| Date | 2014-09-18 15:32:45 GMT-0700 |
| Commit | 0d5d66677d97cff2c6529080e3865c8f778e2552 |
| Parent | d7f5989 |
| -public class Adjacency { | ||
| - /** | ||
| - * Shifts the index for even numbers by 4. | ||
| - */ | ||
| - public static long d( int n, int t ) { | ||
| - long te = t + (1- (t%2)); | ||
| - | ||
| - return (long)((n-(t%2))*Math.floor(t/2) % te) + (t%2) - 1; | ||
| - } | ||
| - | ||
| - public static void main( String args[] ) { | ||
| - int t = 9; | ||
| - for( int i = 1; i <= t; i++ ) { | ||
| - System.out.printf( "%d\n", d(i, t) ); | ||
| - //System.out.printf( "d(%02d) = %d\n", i, d(i, t) ); | ||
| - } | ||
| - } | ||
| -} | ||
| - | ||
| Delta | 0 lines added, 19 lines removed, 19-line decrease |
|---|