MCPcopy Index your code
hub / github.com/TheAlgorithms/Go / sum

Function sum

dynamic/optimalbst.go:55–61  ·  view source on GitHub ↗

Helper function to sum the frequencies

(freq []int, i, j int)

Source from the content-addressed store, hash-verified

53
54// Helper function to sum the frequencies
55func sum(freq []int, i, j int) int {
56 total := 0
57 for k := i; k <= j; k++ {
58 total += freq[k]
59 }
60 return total
61}

Callers 1

OptimalBSTFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected