Less 比较两个元素的大小
(i, j int)
| 36 | |
| 37 | // Less 比较两个元素的大小 |
| 38 | func (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 交换两个元素 |
| 46 | func (pq *PriorityQueue[T]) Swap(i, j int) { |
nothing calls this directly
no outgoing calls
no test coverage detected