trees.go 773 B

123456789101112131415161718192021
  1. // Copyright (c) 2015, Emir Pasic. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Package trees provides an abstract Tree interface.
  5. //
  6. // 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.
  7. //
  8. // Reference: https://en.wikipedia.org/wiki/Tree_%28data_structure%29
  9. package trees
  10. import "github.com/emirpasic/gods/containers"
  11. // Tree interface that all trees implement
  12. type Tree interface {
  13. containers.Container
  14. // Empty() bool
  15. // Size() int
  16. // Clear()
  17. // Values() []interface{}
  18. }