toggle menu
KAHelpers
androidJvm
switch theme
search in API
dataStructuresAndAlgorithms
/
dev.funkymuse.datastructuresandalgorithms.heap
/
ComparatorHeap
Comparator
Heap
class
ComparatorHeap
<
T
>
(
comparator
:
Comparator
<
T
>
)
:
AbstractHeap
<
T
>
Members
Constructors
Comparator
Heap
Link copied to clipboard
constructor
(
comparator
:
Comparator
<
T
>
)
Types
Companion
Link copied to clipboard
object
Companion
Properties
count
Link copied to clipboard
open
override
val
count
:
Int
elements
Link copied to clipboard
var
elements
:
ArrayList
<
T
>
is
Empty
Link copied to clipboard
open
val
isEmpty
:
Boolean
is
Not
Empty
Link copied to clipboard
open
val
isNotEmpty
:
Boolean
Functions
compare
Link copied to clipboard
open
override
fun
compare
(
first
:
T
,
second
:
T
)
:
Int
get
Nth
Smallest
T
Link copied to clipboard
open
override
fun
getNthSmallestT
(
n
:
T
)
:
T
?
insert
Link copied to clipboard
open
override
fun
insert
(
element
:
T
)
is
Min
Heap
Link copied to clipboard
open
override
fun
isMinHeap
(
)
:
Boolean
merge
Link copied to clipboard
open
override
fun
merge
(
heap
:
AbstractHeap
<
T
>
)
peek
Link copied to clipboard
open
override
fun
peek
(
)
:
T
?
remove
Link copied to clipboard
open
override
fun
remove
(
)
:
T
?
remove
At
Link copied to clipboard
open
override
fun
removeAt
(
index
:
Int
)
:
T
?