4 ms·
Sorry, but the implementation posted is O(|pattern| * |name|), not linear. http://ideone.com/2xCXyY http://ideone.com/2xCXyY
by mlgh 9y ago
Sorry, but the implementation posted is O(|pattern| * |name|), not linear.
http://ideone.com/2xCXyY http://ideone.com/2xCXyY
- burntsushi 9y agoThe size of the pattern is held as constant. Or more accurately, "it's linear" is an abbreviated form of "it's linear in the size of the text searched."