Memory address calculation double dimension array 2D array ISC computer science by Prateik

Опубликовано: 16 Апрель 2020
на канале: INFINIAN
111
5

Memory address calculation double dimension array 2D array ISC computer science by Prateik

Address Calculation in Double (Two) Dimensional Array:




Address Calculation in 2D arrays - ISC Computer Science Theory | hindi

this video contains

While storing the elements of a 2-D array in memory, these are allocated contiguous memory locations. Therefore, a 2-D array must be linearized so as to enable their storage. There are two alternatives to achieve linearization: Row-Major and Column-Major.

Address of an element of any array say “A[ I ][ J ]” is calculated in two forms as given:
(1) Row Major System (2) Column Major System

Row Major System:

The address of a location in Row Major System is calculated using the following formula:

Address of A [ I ][ J ] = B + W * [ N * ( I – Lr ) + ( J – Lc ) ]

Column Major System:

The address of a location in Column Major System is calculated using the following formula:

Address of A [ I ][ J ] Column Major Wise = B + W * [( I – Lr ) + M * ( J – Lc )]

Where,
B = Base address
I = Row subscript of element whose address is to be found
J = Column subscript of element whose address is to be found
W = Storage Size of one element stored in the array (in byte)
Lr = Lower limit of row/start row index of matrix, if not given assume 0 (zero)
Lc = Lower limit of column/start column index of matrix, if not given assume 0 (zero)
M = Number of row of the given matrix
N = Number of column of the given matrix


На этой странице сайта вы можете посмотреть видео онлайн Memory address calculation double dimension array 2D array ISC computer science by Prateik длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь INFINIAN 16 Апрель 2020, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 111 раз и оно понравилось 5 зрителям. Приятного просмотра!