https://github.com/pykello/dartlang-suffixarray
Implementation of suffix array data structure for string searching
https://github.com/pykello/dartlang-suffixarray
Last synced: 8 months ago
JSON representation
Implementation of suffix array data structure for string searching
- Host: GitHub
- URL: https://github.com/pykello/dartlang-suffixarray
- Owner: pykello
- License: other
- Created: 2013-04-27T22:39:47.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2013-04-30T18:30:02.000Z (about 13 years ago)
- Last Synced: 2025-04-10T10:21:05.173Z (about 1 year ago)
- Language: Dart
- Size: 109 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
#Suffix Array for Dart
[Suffix Array](http://en.wikipedia.org/wiki/Suffix_array) is a data-structure which can be used for indexing and searching texts.
##Time and Space Complexity
The time complexity for different operations in the current implementation are:
* Create: O(N * log^2 N), where N is length of input string
* Locate: O(P * log N + Occ), where P is length of pattern to be searched, and Occ is size of result
* Count: O(P * log N)
The space complexity of the data structure is O(N).
##Example Usage
The following code creates a suffix array for the string "abcabc" and then searches for substrings in that:
import 'package:suffixarray/suffixarray.dart';
...
SuffixArray suffixArray = new SuffixArray("abcabc");
print(suffixArray.lookup("abc")); // prints [0, 3]
print(suffixArray.count("abc")); // prints 2