Skip to content

mh739025250/suffix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

suffix

This package implements a suffix tree, uses Ukkonen algorithm.

A suffix tree can be built in O(n) operations, find a key in O(k) operations and count a key in O(k) operations.

example

A simple use case:

package main

import (
"fmt"
"github.com/mh739025250/suffix"
)

func main() {
    content := "abcabxabcd"
    tree := suffix.NewSuffixTree()
    tree.BuildFromStr(content)
    fmt.Println(tree.CountStr("ab"))
    fmt.Println(tree.ExistStr("ac"))
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages