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
#include #include int sumFact(int numb); int calculateFactorial(int digit); main() { int numb, sumfact; do{ printf ("Enter a number 1 to 9999\n"); scanf("%

write pseudocode to implement a queue with two stacks

Q. Write down any four applications or implementation of the stack.                                     Ans. (i)       The Conversion of infix to postfix form (ii)

Algo rithm to Insert a Node p at the End of a Linked List is explained below Step1:   [check for space] If new1= NULL output "OVERFLOW" And exit Step2:   [Allocate fr

Given the following search tree, state the order in which the nodes will be searched for breadth first, depth first, hill climbing and best first search, until a solution is reache

A linear list of elements in which deletion can be done from one end (front) and insertion can take place only at the other end (rear) is called as a   Queue.

Determine the greatest common divisor (GCD) of two integers, m & n. The algorithm for GCD might be defined as follows: While m is greater than zero: If n is greater than m, s

After going through this unit, you will be able to: • define and declare Lists; • understand the terminology of Singly linked lists; • understand the terminology of Doubly

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

Linked lists are among the most common and easiest data structures. They may be used to implement various other common abstract data types, including queues, stacks, symbolic expre