int search(int d[N][N], int key) { int i1, i2, j1, j2; i1 = j1 = 0; i2 = j2 = N-1; while(i1 < i2 && j1 < j2){ if(d[i1][j2] == key) return 1; if(d[i1][j2] < key) ++i1; else --j2; } return 0; }
int search(int d[N][N], int key) { int i1, i2, j1, j2; i1 = j1 = 0; i2 = j2 = N-1; while(i1 < i2 && j1 < j2){ if(d[i1][j2] == key) return 1; if(d[i1][j2] < key) ++i1; else --j2; } return 0; }