Say I have an index 12 (12th element) going from left to right, top to bottom.
I have an array[4][4].
What would be the fastest way to compute the index [3][2] given the 1D index 12? (1D index starts at 1).
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Don’t know if this is fastest, but it’s definitely simple:
Assuming array[x][y]
Example: