Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KthLargest ¶
type KthLargest struct {
// contains filtered or unexported fields
}
KthLargest find the kth largest elements in a stream.
func Constructor ¶
func Constructor(k int, nums []int) KthLargest
Constructor accepts an integer k and an integer array nums, which contains initial elements from the stream.
func (*KthLargest) Add ¶
func (kl *KthLargest) Add(val int) int
Add return the element representing the kth largest element in the stream.
Click to show internal directories.
Click to hide internal directories.