public interface ITopK<T>
Modifier and Type | Method and Description |
---|---|
boolean |
offer(T element)
offer a single element to the top.
|
boolean |
offer(T element,
int incrementCount)
offer a single element to the top and increment the count
for that element by incrementCount.
|
List<T> |
peek(int k) |
boolean offer(T element)
element
- - the element to add to the topboolean offer(T element, int incrementCount)
element
- - the element to add to the topincrementCount
- - the increment count for the given countCopyright © 2019. All rights reserved.