Spiral-matrix

View project on GitHub

Spiral Matrix

Spiral Matrix Project

Introduction

The matrix starting from the middile of the matrix and travers to the right in a clock wise direction is called spiral matrix. For example a matrix starting with the number 1 and moving to the right in a clockwise direction a 5 by 5 spiral is formed as follows:

              21 22 23 24 25
              20  7  8  9 10
              19  6  1  2 11
              18  5  4  3 12
              17 16 15 14 13

Note: The sprial matrix must be of X by X size where X is Odd number.

Requirements

Required

  • Apache Maven
  • Java JDK 7

Build

mvn clean install package && cd target && java -jar spiral-matrix-1.0.jar && cd ..

FAQ

License

Copyright (c) 2014 Suman Pal

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.