UrbanPro
true

Learn Programming Languages from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

Address Calculation in Two Dimensional Arrays

Talla Veerendranath
19/09/2019 0 0

Addresses of  Two Dimensional arrays can be calculated by using

1. Row Major representation

2. Column major Representation

1. Row Major representaion: Let X be an array of M Rows and N Columns

Address Location (X [i, j]) = Base Adress of  X + S [N (i-LBofrow) + (j -LBofCol)]

i and j indicates index value of the element whose address you want to search.

Base Adress of  X  is the starting address of the given array. 

S is the memory word required to store given array’s element. 

LBofrow is Lower Boundary of Rows

LBofCol is Lower Boundary of Columns

Example : 

Rows:  2   Columns : 3

   3     4   5
  2     1   6

   0         1         2     

Let base address be 200

w be 2 bytes(int)

Address of x[1,0]=200+2[3[1-0]+[0-0]]

                         =200+2[3-0]

                         =200+6

                         =206

2 Column Major Representation

Address Location (X [i, j]) =  Base Adress of  X + S [(j- LBofrow) +M(i - LBofCol)]

 

0 Dislike
Follow 1

Please Enter a comment

Submit

Other Lessons for You

Learning a new technology
Each and every day new technologies are getting introduced. Its quite clear that to be part of the fast moving professional world you should be upto date with the cutting edge technologies in the market....
S

Saurav Singh

1 0
0

What is the output of this programming?
#include<stdio.h> main() { printf("%d chennai",+1); }
A

Palindrome Number : Java Function
An easier way to find out whether a number is a Palindrome number or not. Eg. 121, 88, 12321 etc public boolean isPalindrome ( int n ) { int rev = 0, r; for( i = n; i > 0; i /= 10 ) { r...

Decorator Advanced ( Passing Parameter )
Hope you read our previous note about the basic concept of python-decorators, if not, please read first Let see what are the possible ways to utilise the decorators in real time.Well, here we are going...

Facebook Analytics
Assume how the Facebook application will store the millions of customer's record in real-time: facebook = { 'jose': { 'name': 'jose', 'age': 33, 'hobby': , # cricket,football 'mobile': 1111111111, 'email':...
X

Looking for Programming Languages Classes?

The best tutors for Programming Languages Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn Programming Languages with the Best Tutors

The best Tutors for Programming Languages Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more