题目:
Given an image represented by an NxN matrix, where each pixel in the image is 4 bytes
write a method to rotate the image by 90 degrees. Can you do this in place?
解决思想:
顺时针:先将矩阵转置 再依次将各行首尾互换
逆时针:
题目:
Given an image represented by an NxN matrix, where each pixel in the image is 4 bytes
write a method to rotate the image by 90 degrees. Can you do this in place?
解决思想:
顺时针:先将矩阵转置 再依次将各行首尾互换
逆时针: