0% found this document useful (0 votes)
4 views1 page

Array Rotation Algorithm Explained

The document discusses the concept of rotating a 2D array by 90 degrees. It provides a visual representation of the original array and the resulting array after rotation. The document also includes a code snippet illustrating the rotation process using nested loops.

Uploaded by

Dhiman1001
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

Array Rotation Algorithm Explained

The document discusses the concept of rotating a 2D array by 90 degrees. It provides a visual representation of the original array and the resulting array after rotation. The document also includes a code snippet illustrating the rotation process using nested loops.

Uploaded by

Dhiman1001
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Array Rotation by 900

10 20 30
40 50 60
70 80 90
100 110 120

100 7 40 10
0
110 8 50 20
0
120 9 60 30
0

0 1 2 3
0 0,3 0,2 0,1 0,0
0,0 1,0 2,0 3,0
1 1,3 1,2 1,1 1,0
0,1 1,1 2,1 3,1
2 2,3 2,2 2,1 2,0
0,2 1,2 2,2 3,2

For (i=0; i<r; i++)


{
For (j=0; j<c; j++)
B [ i] [c-j] = A [ j] [i];
}

You might also like