Suffix tree in Matlab

不想你离开。 提交于 2019-12-25 04:15:34

问题


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.

Could somebody please suggest some solution or some alternate way to this problem, possible in Matlab.


回答1:


Here are a few suggestions for using "pointers" in 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.


来源:https://stackoverflow.com/questions/15517520/suffix-tree-in-matlab

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!