本文介绍了Matlab中的后缀树的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在文本T中找到了最长的子字符串,因此它是字符串S的前缀.停留在实现上.
I am finding longest substring in text T, such that it is a prefix of string S. I have made algorithm using suffix tree which provides less complex solution, but since Matlab doesn't use pointers or any other reference, I am stuck at the implementation.
有人可以提出一些解决方案或其他方法来解决这个问题,这在Matlab中是可能的.
Could somebody please suggest some solution or some alternate way to this problem, possible in Matlab.
推荐答案以下是在Matlab中使用指针"的一些建议:
Here are a few suggestions for using "pointers" in Matlab:
- 您可以简单地使用单元格数组索引作为指针来引用单元格数组元素.这可能是最简单的方法.
- 您可以使用处理类来创建可您可以保留对它的引用.从软件工程的角度来看,它涉及的更多但很好.
- 作为较少的Matlaby解决方案,您可以用C编写算法,并使用mex在Matlab和算法之间建立接口.
- You can simply use cell array indexes as pointers, to reference cell array elements. This is probably the simplest approach.
- You can use a Handle Class for creating classes which you can hold references to. A little more involved but very nice from a software engineering point of view.
- As less Matlaby solution, you could write the algorithm in C and use mex to interface between Matlab and your algorithm.
更多推荐
Matlab中的后缀树
发布评论