Re: [OT] stable algorithm with complexity O(n)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]




Marko Vojinovic wrote:
[...]
> Basically, count the number of appearances of every number in your set. If you 
> have a set a priori bounded from above and below --- which you do,
> [1, n^2] --- you first allocate an array of integers of length n^2. 

By definition, your proposed algorithm is O(n^2), not O(n).

;)

-- 
Benjamin Franz
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux