Calculate address of an element in an array., Data Structure & Algorithms

Assignment Help:

Q. Explain the technique to calculate the address of an element in an array. A 25 × 4 matrix array DATA is stored in memory in 'row-major order'. If base address is 200 and ω = 4 words per memory of the cell.  Calculate the DATA address [12, 3]                                                                                     

Ans:

In a row major representation, address of any element a[i][j] can be found using the formula written below: a[i][j]=base(a)+(i*m+j)*size where base(a) is base address, m is the number of columns and size represent size of word.

DATA[12,3]=200+(12*4+3)*4

=200+(48+3)*4

=200+51*4

=200+204

=404 

 

 

 

 


Related Discussions:- Calculate address of an element in an array.

Which are the two standard ways of traversing a graph, Which are the two st...

Which are the two standard ways of traversing a graph? i. The depth-first traversal   ii. The breadth-first traversal

Bst created in pre- order, Q. Make a BST for the given sequence of numbe...

Q. Make a BST for the given sequence of numbers. 45,32,90,34,68,72,15,24,30,66,11,50,10 Traverse the BST formed in  Pre- order, Inorder and Postorder.

Binary search tree bst, Describe Binary Search Tree (BST)? Make a BST for t...

Describe Binary Search Tree (BST)? Make a BST for the given sequence of numbers. 45, 36, 76, 23, 89, 115, 98, 39, 41, 56, 69, 48 Traverse the obtained tree in Preorder, Inord

Objectives of algorithms, After learning this, you will be able to: u...

After learning this, you will be able to: understand the concept of algorithm; understand mathematical foundation underlying the analysis of algorithm; to understand se

A tree having ''m'' nodes has (m-1) branches. prove., Q. Prove the hypothes...

Q. Prove the hypothesis that "A tree having 'm' nodes has exactly (m-1) branches".      Ans: A tree having m number of nodes has exactly (m-1) branches Proof: A root

Algorithm to count number of nodes, Write an algorithm to count number of n...

Write an algorithm to count number of nodes in the circular linked list.                            Ans. Counting No of Nodes in Circular List Let list be a circular h

Explain the assertions in ruby, Explain the Assertions in Ruby Ruby off...

Explain the Assertions in Ruby Ruby offers no support for assertions whatever. Moreover, because it's weakly typed, Ruby doesn't even enforce rudimentary type checking on opera

Construct a minimum spanning tree, Construct G for α, n, and W given as com...

Construct G for α, n, and W given as command line parameters. Throw away edges that have an asymmetric relation between nodes. That is, if A is connected to B, but B is not connect

Algorithm to delete the specific node from binary searchtree, Q. Write down...

Q. Write down an algorithm to delete the specific node from binary search tree. Trace the algorithm to delete a node (10) from the following given tree. Ans. Algor

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd