github.com/songzhibin97/go-baseutils@v0.0.2-0.20240302024150-487d8ce9c082/structure/trees/trees.go (about) 1 // Package trees provides an abstract Tree interface. 2 // 3 // In computer science, a tree is a widely used abstract data type (ADT) or data structure implementing this ADT that simulates a hierarchical tree structure, with a root value and subtrees of children with a parent node, represented as a set of linked nodes. 4 // 5 // Reference: https://en.wikipedia.org/wiki/Tree_%28data_structure%29 6 package trees 7 8 import "github.com/songzhibin97/go-baseutils/structure/containers" 9 10 // Tree interface that all trees implement 11 type Tree[E any] interface { 12 containers.Container[E] 13 // Empty() bool 14 // Size() int 15 // Clear() 16 // Values() []interface{} 17 // String() string 18 }