Skip to content

SortAO

SortAO is a TypeScript-based algorithm library that offers a wide range of interesting algorithms and data structures with extremely high efficiency. What’s most notable are the signature wrappers, which are ready-to-use and can help you quickly implement an ordered Set and Map.

Please install SortAO using your preferred package manager:

Terminal window
npm install sortao

SortAO is an open, convenient, flexible and efficient option.

Similar to the design of the C++ Policy, the wrapper of SortAO can replace the underlying container to obtain different special capabilities:

It is also possible to implement the SortedKernel interface and use your own underlying container specifically to meet different business requirements.

Most importantly, these carefully designed data structures are all independently usable and do not rely on wrappers.

Inspired by the design of the C++ standard library, we have designed bidirectional cursors that can efficiently access elements in containers.

Under medium and large-scale data, the cursor’s efficiency is consistent with that of the native iterator, and it supports more fine-grained access control. For full traversal, our data structure also implements Internal-Iterable, which can achieve better performance than native iterators.

Functions with JavaScript naming conventions return the value within the container, while functions with C++ naming conventions return the cursor.

We also offer some interesting and independent data structures. Although they cannot be used in conjunction with wrappers, they may be helpful in other business scenarios.