Suppose we have an array myarray of length n, and we say:

int n = myarray.length;

What is the Big O of this statement?

  • A: O(1)
  • B: O(n)
  • C: O(n log n)
  • D: O(n2)
  • E: depends on the item type of myarray

    Answer

    Prev    Next    Page+10