Skip to main content
Module

x/structurae/binary-heap.ts>BinaryHeap#replace

Data structures for high-performance JavaScript applications.
Latest
method BinaryHeap.prototype.replace
import { BinaryHeap } from "https://deno.land/x/structurae@4.0.1/binary-heap.ts";

Returns the first (min/max) element of the heap and replaces it with a given element.

Parameters

element: T

the element to replace the first element of the heap

Returns

T

the first element of the heap