Need an efficient algorithm solve this kind of complex structure
- by Rizvan
Problem Statement is :
Given 2 Dimensional array, print output for example
If 4 rows and 6 columns, output would be:
1 2 3 4 5 6
16 17 18 19 20 7
15 24 23 22 21 8
14 13 12 11 10 9
I tried it is looking like square within square but when I attempted this problem, I put so many while and if loops but didn't got exact answer. If row and columns increases how to handle it?
This is not homework. I was learning solving complex structure so I need to understand it by some guidance.