Git Product home page Git Product logo

light-rbtree's Introduction

Light-rbtree user manual

Light-rbtree is a red black tree library implemented in C language. Although it has a relatively small amount of code, its performance is very powerful. It supports single command insertion, deletion and search. The best thing is that it supports C language for style traversal iterators and supports medium order traversal and subsequent traversal respectively.

Compilation Instructions

It does not has any external dependency, so just make it directly in the project root directory.

cd light-rbtree
make

Run some simple tests

After you finish compiling above, you can run some simple tests.

./examples/simple
./examples/benchmark

Here is the output of benchmark:

Generate 1000000 Node:
  real time: 0.420000
  user time: 0.410000
  kern time: 0.000000
  rb deepth: 24
Middle Iteration:
  real time: 0.080000
  user time: 0.080000
  kern time: 0.000000
Postorder Iteration:
  real time: 0.080000
  user time: 0.070000
  kern time: 0.000000
Deletion All Node...
Done.

Based on Development

Light-rbtree library requires only two files to complete the migration.

src/rbtree.c
src/rbtree.h

Principle introduction

The light rbtree library itself does not perform operations such as comparison, but uses a callback function to let users compare and return a result (greater than zero, less than zero and equal to zero). Therefore, in theory, we can insert infinite data into the red black tree. This design concept is applied to finding nodes (passing in a private data) and finding parent nodes during insertion (comparing two red black tree nodes).

License

This is an open source red black tree library, which uses the GPLV2 protocol

Discussion Group

The Tencent QQ Group number is: 763756024

light-rbtree's People

Contributors

johnsanpe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

lovening

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.