When we fetch a value from array with the index , we can do it in constant time.
eg:
var array = [3,4,56, ......]; var val = array[3]; //running time is constant Let's say we fetch a value value from an object with the property
eg:
var obj = {prop1 : 3, prop2 : 4, prop3 : 56, ......}; var val = obj.prop3; //running time? What is the running time? is it linear or constant?
Thank you in advance...