How many numbers in an array are smaller than a given number?

Posted by Raihan on Stack Overflow See other posts from Stack Overflow or by Raihan
Published on 2010-04-26T02:18:09Z Indexed on 2010/04/26 2:23 UTC
Read the original article Hit count: 189

Filed under:
|
|

The naive one is O(n). Is there a one that is O(log n) or even O(1)?

How about a sorted array? How about using binary search tree?

© Stack Overflow or respective owner

Related posts about c

    Related posts about c++