GithubHelp home page GithubHelp logo

isabella232 / redblacktree Goto Github PK

View Code? Open in Web Editor NEW

This project forked from attaswift/redblacktree

0.0 0.0 0.0 292 KB

Red-Black Trees in Swift

License: MIT License

Swift 99.23% Shell 0.77%

redblacktree's Introduction

Red-Black Trees in Swift

Swift 2.1 License

Build Status Code Coverage

This project provides an implementation of red-black trees in pure Swift as structs with value semantics. The nodes are stored in bulk inside a single flat Array, with array indexes serving as pointers.

RedBlackTree supports value-based lookup, positional lookup, or a combination of both, depending on how you configure its key type, RedBlackKey. For example, you can create a single red-black tree that supports lookup based on either a key stored in each element, the position of the element, or a weighted position.

I created this package to make a set of ordered collection types in Swift. However, benchmarking showed that the performance of red-black trees isn't great, and I chose to base my collection types on b-trees instead. If you're in need of a fast ordered collection type, be sure check out my BTree project before settling on red-black trees.

redblacktree's People

Contributors

lorentey 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.