MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / Less

Method Less

structure/heap/heap_test.go:20–25  ·  view source on GitHub ↗
(o testStudent)

Source from the content-addressed store, hash-verified

18}
19
20func (u testStudent) Less(o testStudent) bool {
21 if u.Score == o.Score {
22 return u.Name < o.Name
23 }
24 return u.Score > o.Score
25}
26
27func TestHeap_Empty(t *testing.T) {
28 tests := []struct {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected