数据结构的实现

问题描述:

我正在开发一个应用程序,该程序使用krap rabbin算法检查.cs文件中的复制文件,该算法查找P是否为T的子字符串.假设P和T都是两个源代码,并且如果P是T的子字符串,则从T ..中复制P.为了提高效率,我们如何在其中使用链表或树?换句话说,应该在其上实现什么数据结构,因为我必须在此应用程序中实现数据结构,并且我正在学习数据结构..

这是拉宾的算法

http://harvestsoft.net/rabinkarp.htm

i am working on application which check .cs files for copy file by using krap rabbin algorithm which find whether P is a sub string of T or not. Assuming that P and T both are two source code and if P is a sub string of T then P is copied from T .. for efficiency how can we use linked list or tree in it?? in other word what data structure should be implement on it because i must implement data structure in this application and i am in learning process of data structure ..

here is rabbin ''s algorithim

http://harvestsoft.net/rabinkarp.htm

让我注意到,没有诸如需要使用这种算法的应用程序"之类的东西.应用程序可能只对应用一种或另一种算法的结果有一些要求.您可能是这个意思: http://en.wikipedia.org/wiki/Rabin%E2%80%93Karp_algorithm [ ^ ].所以有什么问题?对该算法进行了清楚的描述,与列表或树结构无关-请参阅我对该问题的评论.我想我基本上已经解释了原因.

现在,为什么不简单使用System.String.ContainsLastIndexOf.System.StringSystem.String.LastIndexOf?请参阅 http://msdn.microsoft.com/en-us/library/system.string.aspx [^ ] .

—SA
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