| 45 | } |
| 46 | |
| 47 | type MedianFinder struct { |
| 48 | // keep the smaller half of numbers in a max heap for O(1) access to middle |
| 49 | smallerHalf *MaxHeap |
| 50 | |
| 51 | // keep the larger half of numbers in a min heap for O(1) access to middle |
| 52 | largerHalf *MinHeap |
| 53 | } |
| 54 | |
| 55 | /** initialize your data structure here. */ |
| 56 | func Constructor() MedianFinder { |
nothing calls this directly
no outgoing calls
no test coverage detected