Skip to content

Implementation of suffix array data structure for string searching

License

Notifications You must be signed in to change notification settings

pykello/dartlang-suffixarray

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Suffix Array for Dart

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

About

Implementation of suffix array data structure for string searching

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages