MCPcopy Create free account
hub / github.com/GoSimplicity/LinkMe / Less

Method Less

pkg/priorityqueue/priority_queue.go:38–43  ·  view source on GitHub ↗

Less 比较两个元素的大小

(i, j int)

Source from the content-addressed store, hash-verified

36
37// Less 比较两个元素的大小
38func (pq *PriorityQueue[T]) Less(i, j int) bool {
39 if pq.less == nil {
40 return false
41 }
42 return pq.less(pq.items[i], pq.items[j])
43}
44
45// Swap 交换两个元素
46func (pq *PriorityQueue[T]) Swap(i, j int) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected