Giter Site home page Giter Site logo

casusarts / a-collection-of-generic-data-structures-written-in-go Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zyedidia/generic

1.0 1.0 0.0 131 KB

A collection of generic data structures written in Go.

License: MIT License

Go 99.58% Makefile 0.42%

a-collection-of-generic-data-structures-written-in-go's Introduction

Generic Data Structures

Go Reference MIT License

This package implements some generic data structures.

  • avl: an AVL tree.
  • btree: a B-tree.
  • cache: a wrapper around map[K]V that uses a maximum size and evicts elements using LRU when full.
  • hashmap: a hashmap with linear probing. The main feature is that the hashmap can be efficiently copied, using copy-on-write under the hood.
  • hashset: a hashset that uses the hashmap as the underlying storage.
  • mapset: a set that uses Go's built-in map as the underlying storage.
  • multimap: an associative container that permits multiple entries with the same key.
  • interval: an interval tree, implemented as an augmented AVL tree.
  • list: a doubly-linked list.
  • rope: a generic rope, which is similar to an array but supports efficient insertion and deletion from anywhere in the array. Ropes are typically used for arrays of bytes, but this rope is generic.
  • stack: a LIFO stack.
  • trie: a ternary search trie.
  • queue: a First In First Out (FIFO) queue.
  • heap: a binary heap.

See each subpackage for documentation and examples. The top-level generic package provides some useful types and constraints. See DOC.md for documentation.

Contributing

If you would like to contribute a new feature, please let me know first what you would like to add (via email or issue tracker). Here are some ideas:

  • New data structures (bloom filters, graph structures, concurrent data structures, adaptive radix tree, or other kinds of search trees).
  • Benchmarks, and optimization of the existing data structures based on those benchmarks. The hashmap is an especially good target.
  • Design and implement a nice iterator API.
  • Improving tests (perhaps we can use Go's new fuzzing capabilities).

a-collection-of-generic-data-structures-written-in-go's People

Contributors

jan-dubsky avatar nchengyeeshen avatar yangtau avatar yoursunny avatar zyedidia avatar

Stargazers

 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.