data structures - element address in 3 dimensional array -


i looking formulas find memory location of element in 3-d array row major , column major. after using logic end following formulas. array a[l][m][n].

row-major:loc(a[i][j][k])=base+w(m*n(i-x)+n*(j-y)+(k-z))
column-major:loc(a[i][j][k])=base+w(m*n(i-x)+m*(k-z)+(j-y))

where x, y, z lower bounds of 1st(l) 2nd(m) , 3rd(n) index. tried formula , got correct result when applied formula on question in book answer did not match. please can me out this.


Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -