aviate-labs / sorted.mo

Sorted Data Structures in Motoko

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sorted Data Structures

Data structures in which each element is sorted in numerical, alphabetical, or some other order.

Usage

let desc = Order.Descending(Nat.compare);
var l : SortedList.SortedList<Nat> = null;
l := SortedList.insert<Nat>(l, 0, desc);
l := SortedList.insert<Nat>(l, 1, desc);
// [1, 0];

About

Sorted Data Structures in Motoko

License:Apache License 2.0


Languages

Language:Motoko 96.9%Language:Makefile 1.6%Language:Dhall 1.5%