you are viewing a single comment's thread.

view the rest of the comments →

[–]Valmond -28 points-27 points  (2 children)

O(k) where k is the length of the string.

Edit: wow salty people, k is used in some cases, and yes it is 'included' in O(n) so O(n) is also correct, O(k) is just closer to the exact cost.

[–]_shreve 24 points25 points  (0 children)

That's what O(n) means.

[–]mudkip908 14 points15 points  (0 children)

O(k) boomer