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

Write a python program to display dictonary details from list of dictonary
Print the Following: Print all dictonary in a seperate line. Name of all the products. Total quantity of all the products. Details of any product name when provided. Convert all the product name to upper case and print.
A

Ankit P.

0 0
0

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

Memory Management In JAVA
Memory Management in JAVA: When you are starting the JVM then JVM will request some memory from the OS. if OS allocates the required memory then JVM will start otherwise the error message will be displayed...

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

Programming Funds: Data == Information
Commonly, I used to ask this question in my classroom. Most of them will give the answers like: Data means information (or) Information means Data Which is correct? Are both same? Maybe...but not true. Here...

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