Naive solution (The Frequent Words Problem The Frequent Words Problem)

From Algorithm Wiki
Jump to navigation Jump to search

Time Complexity

$O(n)$

Space Complexity

$O(max(n, \sigma^k)$) words

(Keep track of counts on at most $n-k+1$ or $\sigma^k$ words)

Description

Approximate?

Exact

Randomized?

No, deterministic

Model of Computation

Word RAM

Year

1940

Reference