One circular array is given(means memory allocation tales place in circular fashion) diamension(9X7) and sarting add. is 3000,What is the address od (2,3)........ What is the answer? Pls explain to me with steps

This question is related to TCS Interview

Showing Answers 1 - 6 of 6 Answers

vishal

  • Nov 30th, 2006
 

it's a 9x7 int array so it reqiure a 126 bytes for storing.b'ze integer value need  2 byes of memory allocation .

and starting add is 3000

so starting add of 2x3 will be 3012. 

  Was this answer useful?  Yes

I cant draw the pix here so giving the formula
The address would be
B(base add.)+[(i-Row_start)*(Column_limit-Column_start+1)+(j-Column_start)]*width provided that array index start from (1,1).
Here in the formula i,j are the asked index whose address is needed and width is 8 bit as it is integer array.
Now putting value we get
3000+[(2-1)*(7-1+1)+(3-1)]*8=3072

Please reply to this answer. whether it is correct or not.

If the indexing start from 0,0 then diff answer would come out.


  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions