O(N) or O(1)

  • Thread starter Thread starter Boris
  • Start date Start date
B

Boris

What is big-O of

1) System.Collection.ArrayList.Count
2) System.Collection.ArrayList.Queue

Is it O(1) or O(N)? I was not able to find the answer on MSDN or anywhere
else.

thanks,
-Boris
 
Boris said:
What is big-O of

1) System.Collection.ArrayList.Count
2) System.Collection.ArrayList.Queue

Is it O(1) or O(N)? I was not able to find the answer on MSDN or
anywhere else.

Did you mean Queue.Count rather than ArrayList.Queue? If so, I believe
the answer for both is O(1).
 
Back
Top