MCPcopy Create free account
hub / github.com/douchuan/algorithm / enqueue

Method enqueue

src/common/priority_queue.rs:81–85  ·  view source on GitHub ↗

Adds a new key to this priority queue

(&mut self, x: T)

Source from the content-addressed store, hash-verified

79
80 /// Adds a new key to this priority queue
81 pub fn enqueue(&mut self, x: T) {
82 self.pq.push(x);
83 self.n += 1;
84 self.swim(self.n);
85 }
86
87 /// MinPQ: Removes and returns a smallest key on this priority queue
88 /// MaxPQ: Removes and returns a largest key on this priority queue

Callers

nothing calls this directly

Calls 4

ErrEnum · 0.85
pushMethod · 0.80
swimMethod · 0.80
containsMethod · 0.45

Tested by

no test coverage detected