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


in context of realization of project need find k-longest sequences in php. there many ways implement - algorithm fastest php?

which algorithm implement? (overview)

which 1 most-efficient , dynamic (numbers, strings, etc)? (fast?, time n-elems?)

how implement it? (example)

thank you!


post scriptum

i'm implement onisi k-nearest neightbour algorithm. longest sequences visualised in schematic. the interaction history since t , immediate history. shematic gives brief overview on onisi algorithm.enter image description here

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

still questions problematic?

cheers!

which algorithm implement? (overview)

knn special case of variable-bandwidth, kernel density "balloon" estimator uniform kernel

which 1 most-efficient , dynamic (numbers, strings, etc)? (fast?, time n-elems?)

i depends on data structure. array defnetly slower. use of better , advanced structure speed things up.

how implement it? (example)

i highly doubt give here program not small one. have on own.


Comments