Re: [algogeeks] matix flipping

2010-06-08 Thread Varun Nagpal
This question was asked in a Microsoft interview 2 years back. On Mon, Jun 7, 2010 at 8:05 PM, divya jain wrote: > let a[n][n] be the input array nd b[][] be the output > > > for(i=0;i for(j=0;j b[i][j]=a[n-j-1][n-i-1] > > > > On 7 June 2010 08:26, sharad wrote: > >> write a c rou

Re: [algogeeks] matix flipping

2010-06-07 Thread Amit Jaspal
#include using namespace std; int main(){ int a[4][4]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}; int i=0,j,n=3,l=0,m=n; j=n; while(i<=n){ int i1=i,j1=j,k=0,l=n; for(;k wrote: > write a c routine to flip an nXn matrix about its non major diagnol > > > 3 4

Re: [algogeeks] matix flipping

2010-06-07 Thread mohit ranjan
@Sharad, 3 4 5 A= 6 7 9 1 2 8 If B[i,j] = A[n-j, n-i] then --- 8 9 5 B = 2 7 4 1 6 3 Mohit Ranjan On Mon, Jun 7, 2010 at 8:26 AM, sharad wrote: > write a c routine to flip an

Re: [algogeeks] matix flipping

2010-06-07 Thread divya jain
let a[n][n] be the input array nd b[][] be the output for(i=0;i wrote: > write a c routine to flip an nXn matrix about its non major diagnol > > > 3 4 5 > 6 7 9 > 1 2 8 > > Transpose is: > 8 9 5 > 2 7 4 > 1 6 3 > > -- > You r