Matlab中的后缀树

编程入门 行业动态 更新时间:2024-10-26 00:30:39
本文介绍了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中的后缀树

本文发布于:2023-11-29 19:34:49,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1647419.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:后缀   Matlab

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!