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

HTML and Web design-Introduction by Kris, konrad, andy
HTML is a text markup and not a programming language. Theoretically, web page created with HTML should be viewable by anyone with a computer, web browser, internet. In reality, contents of web page...

Black in Python
When you are upturn in your career from beginner to experienced in programming world, your team will start looking at ‘how you are writing?’ Here the responsibility piling up. Okay,...

How to Writing Cleaner & Better Code
For writing code, you need to learn How to writing cleaner & better code. Today I will give you some tips to write cleaner and better system. Below are some suggestions:1) Use Descriptive Names 2)...


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...

Looking for Programming Languages Classes?

Learn from Best Tutors on UrbanPro.

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
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