Purchase Solution

Entry in a Homogeneous Array

Not what you're looking for?

Ask Custom Question

Suppose that a homogeneous array with 6 rows and 8 columns, is stored in row major order starting at address 20 (base ten). If each entry in the array requires only one memory cell, what is the address of the entry in the third row and fourth column? What if each entry requires two memory cells?

Purchase this Solution

Solution Preview

For a two dimension homogenous array stored in row major ordering, we compute the address of an array entry Arr[i][j] as

Address(A[i][j])
= ArrayBase + (i - 1) * (Ncolumns * Se) + (j - 1) * Se
= ArrayBase + Se * ((i - 1) * Ncolumns + (j - 1))

Where,

ArrayBase = starting address of the array
Se = size of single entry
Ncolumns = maximum number of columns per row
i, j = row and column indices respectively, assumed to start from 1.

In the ...

Purchase this Solution


Free BrainMass Quizzes
Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.

C# variables and classes

This quiz contains questions about C# classes and variables.

Javscript Basics

Quiz on basics of javascript programming language.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.