Documentation ¶
Index ¶
- func CreateLevelLinkedList(root *BinaryTreeNode) []*list.List
- func Depth(node *ParentAwareBinaryTreeNode) int
- func DepthFirstSearchBinaryTree(node *BinaryTreeNode) []interface{}
- func IntToInterfaceSlice(array []int) []interface{}
- func StringToInterfaceSlice(array []string) []interface{}
- type BinaryTreeNode
- func (root *BinaryTreeNode) AllSequences() *list.List
- func (root *BinaryTreeNode) CheckBalancedHeight() int
- func (root *BinaryTreeNode) ContainsTree(childRoot *BinaryTreeNode) bool
- func (root *BinaryTreeNode) CountPathsWithSum(targetSum int) int
- func (root *BinaryTreeNode) GetBinaryHeight() int
- func (root *BinaryTreeNode) HasSubTree(childRoot *BinaryTreeNode) bool
- func (root *BinaryTreeNode) IsBalanced() bool
- func (root *BinaryTreeNode) IsBalancedUsingHeightCheck() bool
- func (root *BinaryTreeNode) IsBinarySearchTree() bool
- func (root *BinaryTreeNode) IsBinarySearchTreeWithMinMax(min int, max int) bool
- func (root *BinaryTreeNode) MatchTree(childRoot *BinaryTreeNode) bool
- type DependencyGraph
- type Graph
- type GraphNode
- type ParentAwareBinaryTreeNode
- type Project
- type RandomTreeNode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateLevelLinkedList ¶
func CreateLevelLinkedList(root *BinaryTreeNode) []*list.List
func Depth ¶
func Depth(node *ParentAwareBinaryTreeNode) int
func DepthFirstSearchBinaryTree ¶
func DepthFirstSearchBinaryTree(node *BinaryTreeNode) []interface{}
func IntToInterfaceSlice ¶
func IntToInterfaceSlice(array []int) []interface{}
func StringToInterfaceSlice ¶
func StringToInterfaceSlice(array []string) []interface{}
Types ¶
type BinaryTreeNode ¶
type BinaryTreeNode struct { Value interface{} Left *BinaryTreeNode Right *BinaryTreeNode }
func GetBinaryTreeFromSortedArray ¶
func GetBinaryTreeFromSortedArray(array []int) *BinaryTreeNode
func (*BinaryTreeNode) AllSequences ¶
func (root *BinaryTreeNode) AllSequences() *list.List
func (*BinaryTreeNode) CheckBalancedHeight ¶
func (root *BinaryTreeNode) CheckBalancedHeight() int
func (*BinaryTreeNode) ContainsTree ¶
func (root *BinaryTreeNode) ContainsTree(childRoot *BinaryTreeNode) bool
func (*BinaryTreeNode) CountPathsWithSum ¶
func (root *BinaryTreeNode) CountPathsWithSum(targetSum int) int
func (*BinaryTreeNode) GetBinaryHeight ¶
func (root *BinaryTreeNode) GetBinaryHeight() int
func (*BinaryTreeNode) HasSubTree ¶
func (root *BinaryTreeNode) HasSubTree(childRoot *BinaryTreeNode) bool
func (*BinaryTreeNode) IsBalanced ¶
func (root *BinaryTreeNode) IsBalanced() bool
func (*BinaryTreeNode) IsBalancedUsingHeightCheck ¶
func (root *BinaryTreeNode) IsBalancedUsingHeightCheck() bool
func (*BinaryTreeNode) IsBinarySearchTree ¶
func (root *BinaryTreeNode) IsBinarySearchTree() bool
func (*BinaryTreeNode) IsBinarySearchTreeWithMinMax ¶
func (root *BinaryTreeNode) IsBinarySearchTreeWithMinMax(min int, max int) bool
func (*BinaryTreeNode) MatchTree ¶
func (root *BinaryTreeNode) MatchTree(childRoot *BinaryTreeNode) bool
type DependencyGraph ¶
func BuildGraph ¶
func BuildGraph(projects []string, dependencies [][]string) DependencyGraph
func (*DependencyGraph) AddEdge ¶
func (graph *DependencyGraph) AddEdge(startName string, endName string)
func (*DependencyGraph) GetNodes ¶
func (graph *DependencyGraph) GetNodes() []*Project
func (*DependencyGraph) GetOrCreateNode ¶
func (graph *DependencyGraph) GetOrCreateNode(name string) *Project
type ParentAwareBinaryTreeNode ¶
type ParentAwareBinaryTreeNode struct { Value interface{} Left *ParentAwareBinaryTreeNode Right *ParentAwareBinaryTreeNode Parent *ParentAwareBinaryTreeNode }
func CreatParentAwareBinarySearchTree ¶
func CreatParentAwareBinarySearchTree(array []interface{}) *ParentAwareBinaryTreeNode
func GoUpBy ¶
func GoUpBy(node *ParentAwareBinaryTreeNode, delta int) *ParentAwareBinaryTreeNode
func (*ParentAwareBinaryTreeNode) CommonAncestor ¶
func (node *ParentAwareBinaryTreeNode) CommonAncestor(node1Value interface{}, node2Value interface{}) *ParentAwareBinaryTreeNode
func (*ParentAwareBinaryTreeNode) GetNodesAsSlice ¶
func (node *ParentAwareBinaryTreeNode) GetNodesAsSlice() []*ParentAwareBinaryTreeNode
func (*ParentAwareBinaryTreeNode) InOrderSuccessor ¶
func (node *ParentAwareBinaryTreeNode) InOrderSuccessor() *ParentAwareBinaryTreeNode
type Project ¶
type Project struct { Children []*Project Name string ProjectMap map[string]*Project // contains filtered or unexported fields }
func CreateProject ¶
func FindBuildOrder ¶
func (*Project) AddNeighbour ¶
func (*Project) DecrementDependencies ¶
func (project *Project) DecrementDependencies()
func (*Project) GetChildren ¶
func (*Project) GetNumberDependencies ¶
func (*Project) IncrementDependencies ¶
func (project *Project) IncrementDependencies()
type RandomTreeNode ¶
type RandomTreeNode struct { Value int Left, Right *RandomTreeNode Size int }
func NewRandomTreeNode ¶
func NewRandomTreeNode(value int) *RandomTreeNode
func (*RandomTreeNode) Find ¶
func (root *RandomTreeNode) Find(value int) *RandomTreeNode
func (*RandomTreeNode) GetRandomNode ¶
func (root *RandomTreeNode) GetRandomNode() *RandomTreeNode
func (*RandomTreeNode) InsertInOrder ¶
func (root *RandomTreeNode) InsertInOrder(value int)
Source Files ¶
- 10_contains_tree.go
- 11_random_selecting_tree.go
- 12_paths_with_sum.go
- 1_route_exists.go
- 2_binary_tree_from_array.go
- 3_level_linked_list.go
- 4_binary_tree_is_balanced.go
- 5_tree_is_valid_binary_search_tree.go
- 6_in_order_successor.go
- 7_build_order.go
- 8_comon_ancestor.go
- 9_all_sequences.go
- graph.go
- tree.go
Click to show internal directories.
Click to hide internal directories.