3 ms·
My argument for 0 based indexing is working with multidimensional indices. If I have a 3 row and 2 column matrix stored as a single array of 6 elements, I migh
by conradludgate 6y ago
My argument for 0 based indexing is working with multidimensional indices.
If I have a 3 row and 2 column matrix stored as a single array of 6 elements, I might want to index it using the row,col index.
With 0 based indices, this is fairly simple.
`m[r, c] = m[2r+c]`
With 1 based
`m[r, c] = m[2r+c-2]`
This is similar to the offset based argument but I think it is more related to the actual index rather than the offset.