+ 6
How to create palindromic matrix by array ?
I have array contain nxn element type int , and i know it is palindromic matrix , and problem is how to create output is palindromic matrix ! input : 1 1 1 1 1 3 3 3 3 output : 1 3 1 3 1 3 1 3 1
5 Réponses
+ 4
Create groups of 8, 4 and a group of 1 element if it is an odd number. Then populate the matrix.
+ 3
Once you have the groups you may populate the topleft corner of the matrix. The center is from group 1 if odd, the axis from group of 4 and 8, the rest from 8.
When ready copy it properly to the other three quarters.
+ 2
ok i understand ! thank u so much .
+ 1
thanks , but I need sort element to output ! not check again it right .