Author: | Help |
---|---|
Mode: | factor |
Date: | Fri, 18 Feb 2011 16:52:11 |
Mode(L1k: n1, ..., nk) { Lv := empty list; Find(L1k, Lv); Return entry L¬v which has the biggest number of occurrences; Find(L1k: n1, ..., nk, Lv){ If k=1 Then If n1 is in Lv Then numOccurencen1 := numOccurencen1+1; Else Create entry in Lv (1,n1); EndIf EndIf m := floor(k/2); Find(L1m: n1, ..., nm, Lv); Find(L(m+1)k: nm+1, ..., nk, Lv); } }