Number of the different elements in an array.

Posted by AB on Stack Overflow See other posts from Stack Overflow or by AB
Published on 2010-03-23T17:10:44Z Indexed on 2010/03/23 17:13 UTC
Read the original article Hit count: 110

Is it possible to compute the number of the different elements in an array in linear time and constant space? Let us say it's an array of long integers, and you can not allocate an array of length sizeof(long).

P.S. Not homework, just curious. I've got a book that sort of implies that it is possible.

© Stack Overflow or respective owner

Related posts about algorithm

Related posts about language-agnostic