Documentation
¶
Index ¶
Constants ¶
View Source
const ( // 32-bit magic number for the serialized tree binary format CtreeMagic uint32 = 'C'<<24 | 'T'<<16 | 'R'<<8 | 'E' // File format version Version uint32 = 1 )
Variables ¶
View Source
var ( ErrUnsupportedVersion = errors.New("unsupported version of the file format") ErrInvalidFormat = errors.New("invalid file format") )
Functions ¶
This section is empty.
Types ¶
type SerializedTreeHeader ¶
type Tree ¶
type Tree struct {
N int // The number of nodes in the tree
// contains filtered or unexported fields
}
func DeserializeTree ¶
DeserializeTree returns a *Tree from an io.Reader. Returns ErrUnsupportedVersion if the serialize format is an unsupported version, ErrInvalidFormat if the file is unrecognized.
func NewTree ¶
func NewTree() *Tree
NewTree creates an empty instance of Tree, ready for word insertion.
func (*Tree) FindWordsWithPrefix ¶
FindWordsWithPrefix returns all the words in the tree that start with prefix.
Click to show internal directories.
Click to hide internal directories.