Giter Club home page Giter Club logo

phtree's Introduction

phtree

Release Go Report Card Go Reference License

PH-tree (Permutation Hierarchical Tree) implementation in Go.

Features

  • Insertion and search operations for multi-dimensional keys
  • Removal of key-value pairs from the tree
  • Configurable maximum depth of the tree
  • Thread-safe concurrent access to the tree
  • Efficient handling of high-dimensional and sparse data

Installation

Install the phtree package in your Go project by installing it with the following command:

go get github.com/0xnu/phtree

Usage

Here's a basic example of how to use the phtree package:

package main

import (
	"fmt"
	"github.com/0xnu/phtree"
)

func main() {
	tree := phtree.New(phtree.WithMaxDepth(8))

	tree.Insert([]uint64{0, 1, 2}, "apple")
	tree.Insert([]uint64{0, 1, 3}, "banana")

	value := tree.Search([]uint64{0, 1, 2})
	fmt.Println(value) // Output: "apple"

	tree.Remove([]uint64{0, 1, 3})
}

Check out the examples directory for more detailed usage and examples.

Testing

To run the tests for the PH-Tree package, use the following command:

go test

Performance

To run the benchmarking code, you can use the following command:

go run benchmark/benchmark.go

License

This project is licensed under the MIT License.

Copyright

(c) 2024 Finbarrs Oketunji.

phtree's People

Contributors

0xnu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.