5 votes 5 votes Consider 3 dimensional Array A[90] [30] [40] stored in linear array in column major order. If the base address starts at 10. The location of A[20] [20] [30] is __________ . [Assume the first element is stored at A[1][1][1] and each element take 1 B]. Programming in C array programming-in-c data-structures + – Pankaj Joshi asked Jan 26, 2017 • reshown Jan 24, 2021 by Shaik Masthan Pankaj Joshi 16.0k views answer comment Share Follow See all 9 Comments See all 9 9 Comments reply Show 6 previous comments Vimal Patel commented Dec 12, 2019 reply Follow Share https://stackoverflow.com/a/51751983/8272206 this link also contains formula for 3d column major array address calculation. Further https://en.wikipedia.org/wiki/Row-_and_column-major_order this link also mentions that in (3d in this case) column major ordering first index(plane) changes most frequently. So answer would be 80039. 10 votes 10 votes landstrider commented Jan 1, 2021 reply Follow Share The answer is 80039. This concept is explained in the Dragon Book, though the formula needs to be derived. Refer the solution to 6.4.5 on https://github.com/alirsamar/Dragon-Book-Solutions/blob/master/ch06/6.4/6.4.md. 1 votes 1 votes shashankrustagi commented Jan 25, 2021 reply Follow Share yes 80039 is correct answer 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes col major=80039+10=80049 row major=23589+10=23599 AGNIDEB MUKHERJEE answered Sep 2, 2023 AGNIDEB MUKHERJEE comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes remaining part in commment suryakumarus answered Sep 12, 2023 • edited Sep 12, 2023 by suryakumarus suryakumarus comment Share Follow See all 2 Comments See all 2 2 Comments reply suryakumarus commented Sep 12, 2023 i edited by suryakumarus Sep 12, 2023 reply Follow Share 3 0 votes 0 votes suryakumarus commented Sep 12, 2023 reply Follow Share 1 0 votes 0 votes Please log in or register to add a comment.