Class PriorityQueue

Index

Constructor methods

Properties

Methods

Constructor methods

constructor(capacity: number): PriorityQueue

Parameters

  • capacity: number

Returns

PriorityQueue

Properties

public static count: number

public length: number

Methods

public dequeue(): ScheduledItem

Returns

ScheduledItem

public enqueue(item: ScheduledItem)

Parameters

public heapify(index: number)

Parameters

  • index: number

public isHigherPriority(left: number, right: number): boolean

Parameters

  • left: number
  • right: number

Returns

boolean

public peek(): ScheduledItem

Returns

ScheduledItem

public percolate(index: number)

Parameters

  • index: number

public remove(item: ScheduledItem): boolean

Parameters

Returns

boolean

public removeAt(index: number)

Parameters

  • index: number