import * as collections from "https://deno.land/x/collections@0.12.1/mod.ts";
Classes
A priority queue implemented with a binary heap. The heap is in decending order by default, using JavaScript's built in comparison operators to sort the values. | |
A unbalanced binary search tree. The values are in ascending order by default, using JavaScript's built in comparison operators to sort the values. | |
A red-black tree. The values are in ascending order by default, using JavaScript's built in comparison operators to sort the values. | |
A double-ended queue implemented with a growable ring buffer. Vector is faster than JavaScript's built in Array class for shifting and unshifting because it only requires reallocation when increasing the capacity. |
Functions
Compares its two arguments for ascending order using JavaScript's built in comparison operators. | |
Counts the number of occurances for each value. | |
Compares its two arguments for descending order using JavaScript's built in comparison operators. | |
Returns a random integer within a range. | |
Generates an array of integers within a range. | |
Shuffles an array in-place using the Fisher-Yates shuffle algorithm then returns it. | |
f swap | Swaps the values at two indexes in an array. |