Which of the following addressing modes, facilitates access to an operand whose location is defined relative to the beginning of the data structure in which it appears?
[A].
ascending
[B].
sorting
[C].
index
[D].
indirect
[E].
None of the above
Answer: Option C
Explanation:
No answer description available for this question.
It is also known as direct addressing mode. When you know the right offset of the address of the memory you need. For example if you have an array, then if you need the N-th element of the array, you just add N sizes of the variables to the starting address of the array.
As an oposite it is the sequential addressing mode (or indirect) where you cant calculate the exact address by just offset of the beginning. If the size of each element in the array is not known (for example if you have N null terminated string which size is not known) you need to traverse all the N-1 elements until you find the one you need - the N-th one :)
Shekhar said:
(Sat, Oct 20, 2012 10:12:59 PM)
Just want to add in Pravi's comment that:
Like in books index is given and by referring to which you can directly open that particular page, similarly index is used for addressing elements in data structure.