Skip to main content

All Questions

Filter by
Sorted by
Tagged with
8 votes
3 answers
2k views

Replacing English words in a string with their Spanish equivalents by dictionary lookup

I want to improve my code's performance and running time, looking for write my loops better. For example, I have a dictionary that contains words as keys, and their translation in Spanish as values. ...
Dan's user avatar
  • 81
7 votes
3 answers
3k views

Finding the fastest common prefix of 2 strings in Python

I'm comparing my algorithms, slice_prefix and bit_prefix, with existing ones to find the common prefix length of 2 strings as ...
12345678910111213's user avatar
3 votes
1 answer
311 views

A bitwise common prefix algorithm in Python

Is my algorithm slow because it has problems? Or, is any bitwise common prefix solution not going to give me the performance I'm looking for? After profiling my algorithm, I found that over 60% of ...
12345678910111213's user avatar
4 votes
4 answers
3k views

Efficiently concatenate substrings of long list of strings

I am having performance problems with the following python function: ...
Josh's user avatar
  • 151
6 votes
3 answers
2k views

Search string in a list

...
Patrick's user avatar
  • 369