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

Function TestOptimalBST

dynamic/optimalbst_test.go:24–35  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

22}
23
24func TestOptimalBST(t *testing.T) {
25 t.Run("Optimal Binary Search Tree test cases", func(t *testing.T) {
26 for _, tc := range getOptimalBSTTestCases() {
27 t.Run("testing optimal BST", func(t *testing.T) {
28 actual := dynamic.OptimalBST(tc.keys, tc.freq, tc.n)
29 if actual != tc.expected {
30 t.Errorf("OptimalBST(%v, %v, %d) = %d; expected %d", tc.keys, tc.freq, tc.n, actual, tc.expected)
31 }
32 })
33 }
34 })
35}

Callers

nothing calls this directly

Calls 2

OptimalBSTFunction · 0.92
getOptimalBSTTestCasesFunction · 0.85

Tested by

no test coverage detected