Name: Anonymous 2011-04-13 7:36
hello have array like this matrix 2d
<code>
12345
qwert
asdfg
zxcvb...
</code>
I will given a single index, like m(1, 2) (is 's') and range and returned a list<int> of resulting indexes with the range near index. example ranges(matrix, (1,2), 0) return list of {s} ranges(matrix, (1,2), 1) is returning list {w,a,s,d,x}
example range(matrix, (0,0), 2) is return list {1,2,3,q,w,a}
detail:
*order unimportant
*ignored is indexes outside boundary like up and left to 0,0
how is algorithm written thank
<code>
12345
qwert
asdfg
zxcvb...
</code>
I will given a single index, like m(1, 2) (is 's') and range and returned a list<int> of resulting indexes with the range near index. example ranges(matrix, (1,2), 0) return list of {s} ranges(matrix, (1,2), 1) is returning list {w,a,s,d,x}
example range(matrix, (0,0), 2) is return list {1,2,3,q,w,a}
detail:
*order unimportant
*ignored is indexes outside boundary like up and left to 0,0
how is algorithm written thank