any help it should be appreciable.
any help it should be appreciable.
Last edited by munna_dude; 06-15-2010 at 10:18 PM.
You can read in the entire file, read it in chunks or a letter at a time. No matter what, you'll have to scan through it letter by letter, if you find 'h' take a different path of execution, is the next 'e'?
If not return to your old execution path, if it is, continue until all is found, add 1 to a variable and so on. That's the basic idea I guess, you can do this manually or by using strcmp().
Read large chunks, it'll probably reduce the amount of random reads, saving a little time.
Yeah, but no matter what a block is probably going to be read into the cache. Is the file huge? If so, it might make a difference.
To the OP, your going to face different kind of problems depending on how you do this, for example, how to solve a phrase that crosses two chunks read from a file.
BTW, no one here is likely to give you a complete working solution, get started and ask specific questions when/if you run into problems.
This is as close as it gets to pre-written code: Boyer–Moore–Horspool algorithm - Wikipedia, the free encyclopedia
where has OP gone?
OP == Original Post
OPer == Original Poster
look at the first post. this thread makes no sense
Ok I see, strange.