Sha256: a56e3ba532703e357b2b95109908bc99e3cfbdcaaea728aa0d7be1696328f064

Contents?: true

Size: 369 Bytes

Versions: 166

Compression:

Stored size: 369 Bytes

Contents

package letter

const testVersion = 1

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

166 entries across 166 versions & 1 rubygems

Version Path
trackler-2.2.1.56 tracks/go/exercises/parallel-letter-frequency/example.go
trackler-2.2.1.55 tracks/go/exercises/parallel-letter-frequency/example.go
trackler-2.2.1.54 tracks/go/exercises/parallel-letter-frequency/example.go
trackler-2.2.1.53 tracks/go/exercises/parallel-letter-frequency/example.go
trackler-2.2.1.52 tracks/go/exercises/parallel-letter-frequency/example.go
trackler-2.2.1.51 tracks/go/exercises/parallel-letter-frequency/example.go
trackler-2.2.1.50 tracks/go/exercises/parallel-letter-frequency/example.go
trackler-2.2.1.49 tracks/go/exercises/parallel-letter-frequency/example.go
trackler-2.2.1.48 tracks/go/exercises/parallel-letter-frequency/example.go
trackler-2.2.1.47 tracks/go/exercises/parallel-letter-frequency/example.go
trackler-2.2.1.46 tracks/go/exercises/parallel-letter-frequency/example.go
trackler-2.2.1.45 tracks/go/exercises/parallel-letter-frequency/example.go
trackler-2.2.1.44 tracks/go/exercises/parallel-letter-frequency/example.go
trackler-2.2.1.43 tracks/go/exercises/parallel-letter-frequency/example.go
trackler-2.2.1.42 tracks/go/exercises/parallel-letter-frequency/example.go
trackler-2.2.1.41 tracks/go/exercises/parallel-letter-frequency/example.go
trackler-2.2.1.40 tracks/go/exercises/parallel-letter-frequency/example.go
trackler-2.2.1.39 tracks/go/exercises/parallel-letter-frequency/example.go
trackler-2.2.1.38 tracks/go/exercises/parallel-letter-frequency/example.go
trackler-2.2.1.37 tracks/go/exercises/parallel-letter-frequency/example.go