Row major representation, Data Structure & Algorithms

Row Major Representation

In memory the primary method of representing two-dimensional array is the row major representation. Under this representation, the primary row of the array occupies the first set of the memory location reserved for the array; second row occupies the next set, & so forth.

The representation of row major representation of an Array is shown in Figure

Let us assume the following two-dimensional array:

a          b          c          d

e          f           g          h

i           j           k          l

 

In order to make its equivalent row major representation, we carry out the following procedure:

Move the elements of the second row beginning from the first element to the memory location adjacent to the very last element of the first row. While this step is applied to all the rows except for the first row, you contain a single row of elements. It is the Row major representation.

By application of above demoted process, we get {a, b, c, d, e, f, g, h, i, j, k, l }

 

Row 0

Row 1

Row 2

.....

Row i

 

 

                Figure: Schematic of a Row major representation of an Array

Posted Date: 4/4/2013 6:46:49 AM | Location : United States







Related Discussions:- Row major representation, Assignment Help, Ask Question on Row major representation, Get Answer, Expert's Help, Row major representation Discussions

Write discussion on Row major representation
Your posts are moderated
Related Questions
What are the Objectives of visual realism applications After studying this unit, you should be able to know specific needs of realism, add realism to pictures by el

In this project you will write a program to produce a discrete time simulation of a queue as shown in Fig. 1. Time is slotted on the input and the output. Each input packet follows

Ask question #sdgsdgsdginimum 100 words accepted#

3. A function to convert a complex number in algebraic form to a complex number in phasor form

Explain Dijkstra's algorithm Dijkstra's algorithm: This problem is concerned with finding the least cost path from an originating node in a weighted graph to a destination node

Gouraud Shading The faceted appearance of a Lambert shaded model is due to each polygon having only a single colour. To avoid this effect, it is necessary to vary the colour ac

Advantages of dry running a flowchart When dry running a flowchart it's advisable to draw up a trace table illustrating how variables change their values at every stage in the

The complexity of searching an element from a set of n elements using Binary search algorithm is   O(log n)

Q. Give the algorithm to build a binary tree where the yields of preorder and post order traversal are given to us.