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

Method Push

pkg/priorityqueue/priority_queue.go:53–57  ·  view source on GitHub ↗

Push 添加一个元素

(x interface{})

Source from the content-addressed store, hash-verified

51
52// Push 添加一个元素
53func (pq *PriorityQueue[T]) Push(x interface{}) {
54 if item, ok := x.(T); ok {
55 pq.items = append(pq.items, item)
56 }
57}
58
59// Pop 移除并返回最小元素
60func (pq *PriorityQueue[T]) Pop() interface{} {

Callers 1

EnqueueMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected