[Agent][Bastion] - Bastion mode - 2

This commit is contained in:
zeaslity
2024-04-17 16:42:02 +08:00
parent c0712b7325
commit dacdb6588e
12 changed files with 383 additions and 203 deletions

View File

@@ -0,0 +1,21 @@
package bastion_init
import (
"fmt"
"testing"
)
func TestNewTrie(t *testing.T) {
words := []string{"apple", "apricot", "apprentice", "application"}
tcc := NewTrie()
tcc.InsertAll(words)
prefix := "ap"
closest, err := FindClosestWord(tcc, prefix)
if err != nil {
fmt.Println(err)
} else {
fmt.Printf("The closest word to '%s' is '%s'\n", prefix, closest)
}
}