import { ArrayHeapPQ } from "https://deno.land/x/ssds@0.2.0/mod.ts";
Methods
Gets the index of the specified relation.
Is not safe (i.e. might cause an error by trying to access an index not present in the list of PQNodes). If the given Relation is invalid, returns 0.
Gets the priority value of the specified relation.
If the relation is invalid (e.g. does not exist), will return positive infinity for the priority.
Determines whether the node at the given index has a given relation or not.
If the provided Relation is invalid, will return 'false' by default.
Checks whether an index is acceptable or not.
Checks to verify that:
- The index is within the bounds of the list
- The reference at the index is not 'null'
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.