HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

O(1) distinct elements in an array implies?

Submitted by: @import:stackexchange-cs··
0
Viewed 0 times
arraydistinctimplieselements

Problem

Could someone explain the following question -

Given the following statement viz. Consider an input array a[1..n] of arbitrary numbers. It is given that
the array has only O(1) distinct elements. What does the statement imply ?

Thanks.

Solution

Essentially, it means no matter what the size of the array is (namely, no matter what $n$ is), it will have no more than a fixed constant number of distinct elements. This assumes that you know what the term $O(1)$ means. If not, ask for clarification.

Context

StackExchange Computer Science Q#113060, answer score: 2

Revisions (0)

No revisions yet.