Row major storage, Data Structure & Algorithms

Q. Take an array A[20, 10] of your own. Suppose 4 words per memory cell and the base address of array A is 100. Find the address of A[11, 5] supposed row major storage.                          

Ans.

A[20, 10]

W = 4 words

Base (A) = 100

A [11, 5] → in row major m x n

loc [ a [i] [j] = base (a) + w [n [i - lbr] + ( j - lbc)]

= 100 + 4 [10 (11) + 5]

= 100 + 4[110+5]

=100 + 115 *4

= 560

 

 

Posted Date: 7/13/2012 2:03:54 AM | Location : United States







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

Write discussion on Row major storage
Your posts are moderated
Related Questions
Write an algorithm to test whether a Binary Tree is a Binary Search Tree. The algorithm to test whether a Binary tree is as Binary Search tree is as follows: bstree(*tree) {

The searching technique that takes O (1) time to find a data is    Hashing is used to find a data

algorithm for multiplication of two sparse matrices using link list

Algorithm for determining strongly connected components of a Graph: Strongly Connected Components (G) where d[u] = discovery time of the vertex u throughout DFS , f[u] = f

With the help of a program and a numerical example explain the Depth First Traversal of a tree.

Write an algorithm for binary search. Algorithm for Binary Search 1.  if (low> high) 2.  return (-1) 3.  Mid = (low + high)/2 4.  if ( X = = a[mid]) 5.  return (mid); 6.

Algorithm to Delete a given node from a doubly linked list Delete a Node from Double Linked List DELETEDBL(INFO, FORW, BACK, START, AVAIL,LOC) 1. [Delete Node] Set FOR

how to write a pseudo code using Kramer''s rule

find the grammar of regular expression of (a/?)(a/b)?

Suppose we have a set of N agents and a set of N tasks.Each agent can only perform exactly one task and there is a cost associated with each assignment. We would like to find out a