Skip to content

Latest commit

 

History

History
51 lines (36 loc) · 1.26 KB

File metadata and controls

51 lines (36 loc) · 1.26 KB

Go Coverage Go Report Card

goTree

On this project I implement a tree data structure in Go for 2 types of self-balancing trees:

For the AVL Tree I implemented the following methods:

  • Insert
  • Delete
  • Search
  • Preorder
  • Height
  • String

For the Red-Black Tree I implemented the following methods:

  • Insert
  • Search
  • Preorder
  • Height
  • String_

Both trees are generic, so they can be used with any type of data, as long as the type implements the interface Comparable.

Setup

Just install Go 1.21 and clone the repository. Golang automatically downloads the dependencies.

Run main with some examples

go run cmd/main.go

Run tests

go test ./...

Future work

  • Implement the other methods for the AVL Tree and Red-Black Tree
  • Create a interface shared both by the AVL Tree and Red-Black Tree
  • Implement a dictionary of suffixes using the implemented trees, comparing the performance between them for different operations.