开发者

Finding the k-longest sequences in an one-dimensional array?

开发者 https://www.devze.com 2023-03-01 07:28 出处:网络
In context of the real开发者_如何转开发ization of a project I need to find the k-longest sequences in PHP. There are many ways to implement this - but which algorithm is the fastest for PHP?

In context of the real开发者_如何转开发ization of a project I need to find the k-longest sequences in PHP. There are many ways to implement this - but which algorithm is the fastest for PHP?

Which algorithm would you implement? (overview)

Which one is most-efficient and dynamic (numbers, strings, etc)? (fast?, time for n-elems?)

How would you implement it? (example)

Thank you!


Post Scriptum

I'm about to implement the ONISI k-nearest neightbour algorithm. The longest sequences are visualised in this schematic.

Finding the k-longest sequences in an one-dimensional array?

This shematic gives a brief overview on the ONISI algorithm.

Finding the k-longest sequences in an one-dimensional array?

The total/immediate-history-elements are strings representing a $state --> $action pattern. This means, considering the first 3 elements of schematic (1), data would be displayed, for instance, like: $immediate_history = array( array( "s2" => "a2" ), array( "s3" => "a3" ), array( "s1" => "a1" ) [..] );

Still any questions about the problematic?

Cheers!


Which algorithm would you implement? (overview)

KNN is a special case of a variable-bandwidth, kernel density "balloon" estimator with a uniform kernel

Which one is most-efficient and dynamic (numbers, strings, etc)? (fast?, time for n-elems?)

I depends on your data structure. An array is defnetly slower. But use of better and advanced structure will speed things up.

How would you implement it? (example)

I highly doubt anyone will give you this here as the program is not a small one. You have to do this on your own.

0

精彩评论

暂无评论...
验证码 换一张
取 消