#suffix-array #suffix #binary

sa-is

The SA-IS algorithm for suffix array construction

1 unstable release

new 0.1.0 Jan 3, 2025

#738 in Algorithms

Download history 108/week @ 2025-01-01

108 downloads per month

MIT license

22KB
390 lines

sa-is

Suffix Array Induced Sorting (SA-IS) algorithm based on the paper "Linear Suffix Array Construction by Almost Pure Induced-Sorting" by G. Nong, S. Zhang and W. H. Chan and the C++ implementation in Chromium.

Usage

use sa_is::make_suffix_array;

let answer = make_suffix_array(b"banana", char::MAX as usize);
assert_eq!(answer, [5, 3, 1, 0, 4, 2]);

License

This project is licensed under both the BSD-3-Clause and MIT licenses:

  1. The original code from the Chromium project is licensed under the BSD-3-Clause license.
  2. Any new contributions made to this project are licensed under the MIT license.

See the LICENSE file for details.

Dependencies

~1MB
~25K SLoC