MCPcopy Create free account
hub / github.com/austingebauer/go-leetcode / Pop

Method Pop

find_median_from_data_stream_295/solution.go:40–45  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

38 *h = append(*h, x.(int))
39}
40func (h *MinHeap) Pop() interface{} {
41 v := *h
42 p := v[len(v)-1]
43 *h = v[0 : len(v)-1]
44 return p
45}
46
47type MedianFinder struct {
48 // keep the smaller half of numbers in a max heap for O(1) access to middle

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected