2. With respect to linked, establish the relationship between the size of the list and the time it takes to perform random access (read a the value stored at a given position somewhere in the list). Provide empirical evidence to support your answer.
Suppose n be the size of the list i.e number of node in the list. if we want to access the node at index i then first of all we have to go to the ith node by traversing one node at a time starting from head node. in the worst case if we want to access nth node then we have to traverse all the node so in this case total number of node accessing in order to access nth is n node.if we want to access first node i.e i=0 then in this it will take constant time. in general we have to access i node in ordered to get the ith node.
Note:- if you have any problem let me know i will try to help you.Thank you.
Get Answers For Free
Most questions answered within 1 hours.