Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
798 views
in Computer by (53.5k points)

An array S[10] [30] is stored in the memory along the column with each of its element occupying 2 bytes. Find out the memory location of S[5][10], if element S[2][15] is stored at the location 8200.

1 Answer

+1 vote
by (53.3k points)
selected by
 
Best answer

OPTION 1:

ASSUMING LBR=LBC=0

W=2 BYTES, NUMBER OF ROWS(M)=10, NUMBER OF COLUMNS(N)=30

LOC(S[I][J]) = B +(I + J*M)*W LOC(S[2][15]) = B +(2+15*10)* 2 8200 = B + (152*2)

B = 8200 - 304

B = 7896

LOC(S[5][10]) = 7896 +(5+10*10)* 2

= 7896 + (105*2)

= 7896 + 210

= 8106

OPTION 2:

ASSUMING LBR=2,LBC=15 AND B = 8200

W=2 BYTES, NUMBER OF ROWS(M)=10, NUMBER OF COLUMNS(N)=30

LOC(S[I][J]) = B +((I-LBR) + (J-LBC)*M)*W

LOC(S[5][10])= 8200 + ((5-2) + (10-15)*10)*2

= 8200 + (3 + (-5)*10) * 2

= 8200 + (3 + (-50)) * 2

= 8200 + (3 – 50) * 2

= 8200 + (-47) * 2

= 8200 – 94

= 8106 

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...