R

Ram Sharma • 3.40K Points
Extraordinary

Q. What is the time complexity of `get()` in an ArrayList?

  • (A) O(n)
  • (B) O(log n)
  • (C) O(1)
  • (D) O(n log n)
  • Correct Answer - Option(C)
  • Views: 10
  • Filed under category Java
  • Hashtags:

Explanation by: Ram Sharma
`ArrayList` provides O(1) time complexity for accessing an element by index.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.