1.

What is the worst case complexity of accessing an element in ArrayList?(a) O(n)(b) O(1)(c) O(nlogn)(d) O(2)

Answer» Right option is (b) O(1)

To explain I would say: ArrayList has O(1) complexity for accessing an element in ArrayList. O(n) is the complexity for accessing an element from LinkedList.


Discussion

No Comment Found

Related InterviewSolutions