Search
Preparing search index...
The search index is not available
gtools
Options
All
Public
Public/Protected
All
Inherited
Externals
Menu
gtools
models/data-structures/priority-queue
PriorityQueue
Class PriorityQueue<T>
Type parameters
T
Hierarchy
PriorityQueue
Implements
G43BasicCollection
<
T
>
Index
Constructors
constructor
Properties
heap
Accessors
length
Methods
add
clear
contains
for
Each
heapify
peek
pop
swap
create
Max
Queue
create
Min
Queue
Constructors
constructor
new
Priority
Queue<T>
(
comparator
:
(
a
:
T
, b
:
T
)
=>
boolean
)
:
PriorityQueue
<
T
>
Type parameters
T
Parameters
comparator:
(
a
:
T
, b
:
T
)
=>
boolean
(
a
:
T
, b
:
T
)
:
boolean
Parameters
a:
T
b:
T
Returns
boolean
Returns
PriorityQueue
<
T
>
Properties
Private
heap
heap
:
T
[]
= []
Accessors
length
get
length
(
)
:
number
Returns
number
Methods
add
add
(
element
:
T
)
:
void
Parameters
element:
T
Returns
void
clear
clear
(
)
:
void
Returns
void
contains
contains
(
item
:
T
)
:
boolean
Parameters
item:
T
Returns
boolean
for
Each
for
Each
(
callback
:
(
item
:
T
, index
:
number
)
=>
boolean
)
:
void
Parameters
callback:
(
item
:
T
, index
:
number
)
=>
boolean
(
item
:
T
, index
:
number
)
:
boolean
Parameters
item:
T
index:
number
Returns
boolean
Returns
void
Private
heapify
heapify
(
index
:
number
)
:
void
Parameters
index:
number
Returns
void
peek
peek
(
)
:
T
Returns
T
pop
pop
(
)
:
undefined
|
T
Returns
undefined
|
T
Private
swap
swap
(
indexOne
:
number
, indexTwo
:
number
)
:
void
Parameters
indexOne:
number
indexTwo:
number
Returns
void
Static
create
Max
Queue
create
Max
Queue<T>
(
valueExtractor
:
(
value
:
T
)
=>
number
)
:
PriorityQueue
<
T
>
Type parameters
T
Parameters
valueExtractor:
(
value
:
T
)
=>
number
(
value
:
T
)
:
number
Parameters
value:
T
Returns
number
Returns
PriorityQueue
<
T
>
Static
create
Min
Queue
create
Min
Queue<T>
(
valueExtractor
:
(
value
:
T
)
=>
number
)
:
PriorityQueue
<
T
>
Type parameters
T
Parameters
valueExtractor:
(
value
:
T
)
=>
number
(
value
:
T
)
:
number
Parameters
value:
T
Returns
number
Returns
PriorityQueue
<
T
>
Modules
models/data-
structures/priority-
queue
Priority
Queue
constructor
heap
length
add
clear
contains
for
Each
heapify
peek
pop
swap
create
Max
Queue
create
Min
Queue
Generated using
TypeDoc