I have one very basic question. In java(or I think valid for any similar language), what's the retrieval time of an element from an array. Since the size of array and its element type is a constant known at compile time or computed at run-time, I believe that retrieval should happen in constant time, O(1). For example,
int[] arr = new int[10];
Though I am not sure of internal memory representation of array, I think operation like arr[3], should directly access memory after calculating address from array start address, size of element type(here 32) and index passed(here 3) something like below:
address of arr[3] = address of a[0] + 32 * 3.
Thanks for the help.