|
Procrastination!
You move the problem of finding the largest common substring in two strings to finding the largest common sequence of tokens in two token streams.
You know that it ruins a joke if you have to explain it, don't you?
"I had the right to remain silent, but I didn't have the ability!"
Ron White, Comedian
|
|
|
|
|
Right, the tokens are just characters, so that's done.
|
|
|
|
|
The fastest Levenshtein distance algorithm I've tried converted strings to integer arrays first.
Wrong is evil and must be defeated. - Jeff Ello
(√-sh*t) 2
|
|
|
|
|
Might be sacrificing space for speed?
What size character and integer? Did it convert individual 8-bit characters to 32-bit integers? Or put four characters in each integer?
|
|
|
|
|
PIEBALDconsult wrote: Might be sacrificing space for speed?
Yes but not badly so.
PIEBALDconsult wrote: What size character and integer?
UTF16 (windows internal) and Int32.
The point is simply that integer math is faster than string comparisons.
Wrong is evil and must be defeated. - Jeff Ello
(√-sh*t) 2
|
|
|
|
|
Jörgen Andersson wrote: string comparisons
Sure, but you don't do any actual string comparisons, only character comparisons, which are very similar to integer comparisons in most repects.
|
|
|
|
|
To create tokens for video game play. Like the old arcades.
|
|
|
|
|
I'm going to help Santa out with his luggage that is left over.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Jörgen Andersson wrote: To find the longest common substring between two strings. Good times, you can do it in O(n+m). Suffix trees are pretty cool.
Jörgen Andersson wrote: Assume that both strings are in the same language, etc Why? None of this matters. It's a problem on strings, what they mean is of no consequence.
"tag" is a substring of both "let's play laser tag next weekend" and of "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn".
|
|
|
|
|
harold aptroot wrote: Why? None of this matters. It's a problem on strings, what they mean is of no consequence.
Depends on how you attack the problem. I'm not limiting you to existing solutions you find on wikipedia.
Or maybe I'm just confusing you.
Wrong is evil and must be defeated. - Jeff Ello
(√-sh*t) 2
|
|
|
|
|
This question was asked in the lounge in the last couple of months......well, at least I'm sure it was.
|
|
|
|
|
Link?
Wrong is evil and must be defeated. - Jeff Ello
(√-sh*t) 2
|
|
|
|
|
|
Stealing that one.
Wrong is evil and must be defeated. - Jeff Ello
(√-sh*t) 2
|
|
|
|
|
No need to, it is all over the internet, it was one of the 'big things' that were discussed earlier in the year.
Just go to google and search 'shruggie'.
I have it as an alternate email signature at work in outlook, and if someone asks a daft question I just reply with a blank email and change the signature! Comes in handy
|
|
|
|
|
Well, haven't seen it before and I can see the use.
Wrong is evil and must be defeated. - Jeff Ello
(√-sh*t) 2
|
|
|
|
|
|
|
Search what?
|
|
|
|
|
'shruggie', what the emoticon is....
|
|
|
|
|
|
The real challenge is to code (sober) while it's christmas!
Seriously, I had a fun assignment at work a few years back and I could code on it whenever I wanted (which included (or rather, especially) at home, for a nice compensation). So at christmas day, after all the dining and drinking (I don't drink alcohol, so I was sober) I decided to work on it a bit, just for fun. After christmas I got called by HR asking me if everything was alright and if I had troubles at home. Puzzled I answered everything was fine and asked him why he asked. "Because you've been working late at christmas..."
I explained to him I just had a fun assignment and that I liked coding and also do it in my spare time. I guess he was more puzzled than me
My blog[ ^]
public class SanderRossel : Lazy<Person>
{
public void DoWork()
{
throw new NotSupportedException();
}
}
|
|
|
|
|
|
I'm aware of that, but the point was actually to reinvent the wheel. Preferrably in an enhanced way.
There's no challenge in googling. (Who am I kidding? Just check Q&A :-/)
Wrong is evil and must be defeated. - Jeff Ello
(√-sh*t) 2
|
|
|
|
|
I know man. I was bored. And well, Google was there. The devil made me do it!!
Jeremy Falcon
|
|
|
|