One-pass algorithm: Difference between revisions

Content deleted Content added
Find the ''n''th element from the end is not possible in a single pass. in a list of k elements there will be 2k-n reads which is >1 pass
No edit summary
Line 4:
 
Basically one-pass algorithm operates as follows:
(1)# theThe object descriptions are processed serially;
(2)# theThe first object becomes the cluster representative of the first cluster;
(3)# eachEach subsequent object is matched against all cluster representatives existing at its processing time;
# A given object is assigned to one cluster (or more if overlap is allowed) according to some condition on the matching function;
its processing time;
(4)# awhen givenan object is assigned to onea cluster (orthe morerepresentative iffor overlapthat iscluster allowed)is accordingrecomputed;
(6)# if an object fails a certain test it becomes the cluster representative of a new cluster
to some condition on the matching function;
cluster (7)# nothing happened
(5) when an object is assigned to a cluster the representative for that cluster is
recomputed;
(6) if an object fails a certain test it becomes the cluster representative of a new
cluster (7) nothing happened
==Example problems solvable by one-pass algorithms==
Given any list as an input: