Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/algorithm/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/visual-studio-2010/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Algorithm Pascal中的Pos()函数使用什么算法?_Algorithm_Time Complexity_Pascal_String Search - Fatal编程技术网

Algorithm Pascal中的Pos()函数使用什么算法?

Algorithm Pascal中的Pos()函数使用什么算法?,algorithm,time-complexity,pascal,string-search,Algorithm,Time Complexity,Pascal,String Search,作为标题,蛮力,卡普拉宾,克努特莫里斯普拉特,博耶摩尔。。。否则呢?Pascal中的Pos()函数有多复杂?在Delphi中,它是手工编码的汇编程序蛮力。可能在D2006和更高版本中由fastcode项目重做。在Turbo Pascal中,它也是手工编码的汇编程序,但较旧(可能是代表scasb) 在自由Pascal上,它使用indexbyte(),这是一个依赖于体系结构的原语“在内存块中搜索字节”,由dword扫描实现 看,它只是扫描第一个相等的字符,所以我想这就是暴力的意思 可以使用各种Del

作为标题,蛮力,卡普拉宾,克努特莫里斯普拉特,博耶摩尔。。。否则呢?Pascal中的Pos()函数有多复杂?

在Delphi中,它是手工编码的汇编程序蛮力。可能在D2006和更高版本中由fastcode项目重做。在Turbo Pascal中,它也是手工编码的汇编程序,但较旧(可能是代表scasb)

在自由Pascal上,它使用indexbyte(),这是一个依赖于体系结构的原语“在内存块中搜索字节”,由dword扫描实现

看,它只是扫描第一个相等的字符,所以我想这就是暴力的意思

可以使用各种Delphi Boyer-Moore实现,以防您必须搜索较大的文本,但由于额外的内存分配,这些实现通常在短字符串上得分很低

(2020-06-04在Lazarus论坛的帖子中引用了以下内容:

同时还有一个
)

可能取决于编译器,您必须指定您所指的pascal编译器。一般来说,我会假设暴力,如果你想要一个特定的算法,你必须找到一个库或自己编写代码。