leetcode

package
v0.0.0-...-0e3bca9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2019 License: Unlicense Imports: 0 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL