In context of the realization 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.
This shematic gives a brief overview on the ONISI algorithm.
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!