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
Handout 15 COMP 264: Introduction to Computer Systems (Section 001) Spring 2013 R. I. Greenberg Computer Science Department Loyola University Water TowerCampus, Lewis Towers 524 82

What is A Container Taxonomy It's useful to place containers in a taxonomy to help understand their relationships to one another and as a basis for implementation using a class

what is frequency count with examble

First - Fit Method: -    The free list is traversed sequentially to search the 1st free block whose size is larger than or equal to the amount requested. Once the block is found it

how to reduce the number of passes in selection sort

Suppose you are given the results of 5 games of rock-paper-scissors. The results are given to you on separate pieces of paper; each piece says either 'A' if the first person won, o

Define Hashing. Store the following values in a hash table of table size 11 using division method: 25, 42, 96, 101, 102, 162, and 197. In case of collision, use other hash functio

human resource management project work in c++

Double ended queues are implemented along doubly linked lists. A doubly link list can traverse in both of the directions as it contain two pointers namely left pointers and righ

Data records are stored in some particular sequence e.g., order of arrival value of key field etc. Records of sequential file cannot be randomly accessed i.e., to access the n th