Let me note that there is not such thing as "application which needs to use such algorithm"; the application may only have some requirements for result of application of one or another algorithm. You probably mean this:
http://en.wikipedia.org/wiki/Rabin%E2%80%93Karp_algorithm[
^]. So, what's the problem? The algorithm is clearly described and has nothing to do with list or tree structure — please see my comment to the question. I think I basically explained why.
Now, why won't you simply use
System.String.Contains
,
LastIndexOf.System.String
or
System.String.LastIndexOf
? See
http://msdn.microsoft.com/en-us/library/system.string.aspx[
^].
—SA