2d Array

Hello ,
I have the 2d array which is represented as following :

1000000000
1100000000
0111100000
0000111111

How can I traverse through 'one' elements only ?
any help would be appreciated :) .
Without additional metadata, you can't. You must traverse the whole array, and decide to act only when the element is a 'one'.
could you tell me what kind of metadata ?
and how can I traverse through if I have these metadata ?
Thanks :).
Like pointers to the next 'one'. For such a small array, you are wasting your time. Just iterate through the whole thing and only take action when the value is 1.
Topic archived. No new replies allowed.