This week's book giveaways are in the Refactoring and Agile forums. We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line! See this thread and this one for details.
Hs Raveendran wrote:Which is the efficient algorithm to find the occurrence of a given string in a given large text file.
There are two prime algorithms for doing this - the Knuth-Morris-Pratt algorithm and the Boyer-Moore algorithm. Both are fairly easy to implement and Google will provide the details. In this case I would probably use the Knuth-Morris-Pratt algorithm since it requires no backtracking.
Retired horse trader.
Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.