CS Fundamentals Trainer · Algorithms & Data Structures · JavaScript

What is the time complexity of this code?

function first(arr) {
  return arr[0];
}
  1. O(1)
  2. O(log n)
  3. O(n)
  4. O(n log n)

Difficulty: easy

Answer this question

Related questions