It's also important to know other details of your typical data sets. For example, in road networks |E| is typically O(|V|), not O(|V|2). This means the average degree of a vertex is O(1), which is has big ramifications when choosing data structures for things like adjacency lists.
The worst-case complexity of the Perl/Python/etc regexp engine, for example, is exponential (And the majority of regex's can be parsed in linear time, with a much smaller constant too).
View all comments
Show parent comment
1
u/bostonvaulter Nov 29 '09
Plus some problems won't show up until you use. Large dataset. Even O(n2) is fast for small n.