Sha256: aa0c6545a88063db7b509f4162bd8b3b7620cfb4972cc9186503744d8868cdad
Contents?: true
Size: 346 Bytes
Versions: 230
Compression:
Stored size: 346 Bytes
Contents
package letter func ConcurrentFrequency(l []string) FreqMap { switch len(l) { case 0: return FreqMap{} case 1: return Frequency(l[0]) } ch := make(chan FreqMap) f := func(l []string) { ch <- ConcurrentFrequency(l) } half := len(l) / 2 go f(l[:half]) go f(l[half:]) m := <-ch for r, n := range <-ch { m[r] += n } return m }
Version data entries
230 entries across 230 versions & 1 rubygems