Skip to main content
Module

x/ssds/mod.ts>ArrayHeapPQ#_shouldSwap

Some Specialized Data Structures for Deno.
Latest
method ArrayHeapPQ.prototype._shouldSwap
import { ArrayHeapPQ } from "https://deno.land/x/ssds@0.2.0/mod.ts";

Determines if the node should be swapped with its relation or not.

The method will return 'true' if the relation exists and comparison of the priorities shows that the two should be swapped.

Parameters

index: number

The index whose relation's "swappiness" is to be queried.

relation: Relation

The relation to be queried about.

Returns

boolean

Whether the node should be swapped with its relation.