dict

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package dict encapsulates the structure which is in charge of populating the petname array

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Print

func Print(w io.Writer, n *Node, ns int, ch rune)

Print draws the current tree (only useful for debugging)

Types

type Node

type Node struct {
	Key   int
	Left  *Node
	Right *Node
}

Node represents a node in the Used binary tree to accelerate search speed

type Tree

type Tree struct {
	Root  *Node
	Depth int
}

Tree is a representation of a binary search tree

func (*Tree) Insert

func (t *Tree) Insert(k interface{})

Insert inserts a key into a binary tree

func (*Tree) Search

func (t *Tree) Search(k []int) bool

Search finds a consecutive series of int in the binary tree

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL