![]() |
TheAlgorithms/C++ 1.0.0
All the algorithms implemented in C++
|
Print the elements of a matrix traversing it spirally. More...
#include <iostream>Go to the source code of this file.
Functions | |
| void | genArray (int **a, int r, int c) |
| void | spiralPrint (int **a, int r, int c) |
| int | main () |
Print the elements of a matrix traversing it spirally.
Definition in file spiral_print.cpp.
| void genArray | ( | int ** | a, |
| int | r, | ||
| int | c ) |
Arrange sequence of numbers from '1' in a matrix form
| [out] | a | matrix to fill |
| [in] | r | number of rows |
| [in] | c | number of columns |
Definition at line 12 of file spiral_print.cpp.
| int main | ( | void | ) |
main function
Definition at line 69 of file spiral_print.cpp.
| void spiralPrint | ( | int ** | a, |
| int | r, | ||
| int | c ) |
Traverse the matrix spirally and print the sequence of elements
| [in] | a | matrix to read from |
| [in] | r | number of rows |
| [in] | c | number of columns |
Print start row
Print the end col
Print the end row
Print the start Col
Definition at line 29 of file spiral_print.cpp.