|
|
вернуться в форумОбщий форумBoyer-Moore in exchange for a bier...Tempting?? Boyer-Moore in exchange for a bier...Tempting?? Searching a substring in a given text... How hard can it be?? Well it's not very hard but it's very slow if your thinking at O(N*N). An improved solution was given by Rabin and Karp ( O(n) in the best case ) but this is not enough... if there was something with O(n) in all cases... 2 more remarcable solutions were given by: - (1977) Knuth, Morris and Pratt, an algorithm with O(n) in all the cases - (1977) Boyer-Moore, offered the best solution known until then (and now) for searching a substring in a given text Enough with the history lessons!!! I searched the INTERNET for the last algorithm but I didn't have any luck (what is it with this algorhitm - secret or something???) ANYWAY I see there are some really clever guys here and I wondered if someone can help me... anyone out there?... So, if you know something about the Boyer-Moore algorithm and you want to share with others (especially with me) don't be shy! Source ( /*prefferably commented*/ ) C/C++/Pascal is welcomed like any other comment or suggestion. The One who will give the best explanation will be rewarded with a bier, or maybe a juice if he/she doesn't drink bier, when they will come visit me ROMANIA. I finish with my e-mail adress in case you need it: progady@enigma.ro P.S. Sorry for my english/vocabulary mistakes if there are any of them. By the way if no one will help me I will be killed and eaten by a group of blood-thirsty, programmer-eating beasts! Re: Boyer-Moore in exchange for a bier...Tempting?? Re: Boyer-Moore in exchange for a bier...Tempting?? Well, it seem's there is somebody out there after all... Hmm... I was starting to think I'm all alone in the dark... just me and... This start's to sound like a horror movie, so i will go on with this: Thank you for your reply, but once again this demonstrates that I am a very unlucky person. This time is not so bad (this year I lost the city olympiad because the name of my source was not 8 character's long... When I think that the second problem was perfect!... but the output was from x,y, length instead of length ,x,y-> but it still managed to get 20 points because sometimes this values were equal... just like in the stupid test of the problem.) Anyway I started jumping up and down when I saw your reply but when i clicked every single link the same apocalyptic message: "could not find server" Well what shall I do in this case? Should I commit suicide? No because i did not finished my first game in opengl so I Need some help (you could e-mail me some source code or papers) if you don't have anything else to do... (you know, feeding your dog/cat, killing my CHEMISTRY TEACHER) Thanks again and hope to hear from you soon! I have to mention that I don't have internet at home (I am not very rich you know... but still i'm doing well) and know i'm at a internet cafe. Good bye for now from an unlucky 17 year old boy... just hope i will not be hit by a car on my way home... Re: Boyer-Moore in exchange for a bier...Tempting?? All the links are correct! May be therer are problems with your networks/proxies! Re: Boyer-Moore in exchange for a bier...Tempting?? Finally... I managed to get the code Thanks. |
|
|