Skip to content

A C++ dynamic library that implements a binary search tree data structure. Created for educational purposes.

Notifications You must be signed in to change notification settings

CamNZ/binary-search-tree

Repository files navigation

Binary Search Tree .so

A C++ dynamic library that implements a binary search tree data structure. Created for educational purposes.

Getting Started

Prerequisites

Ubuntu >= 16.04
Python ctypes

Has not been tested on other operating systems, but should be easy to compile with minor changes to build process.

Installing

git clone
make all
make test

Usage

Can be linked to from any language that supports calls to a C interface (Python, Matlab, C#, etc). See interface.hpp for full public interface. See example.py for an example of linking from python using the ctypes module.

Max node limit

By default the maximum node limit is set to 20,000. This is to prevent stack overflow from a large number of stack frames being generated by recursive calls. Even though binary search trees are famed for their O(log n) operations, this only holds true if the tree is balanced. If the tree is imbalanced the worst case is O(n).

Feedback

Any constructive feedback on how this could be improved is welcome

About

A C++ dynamic library that implements a binary search tree data structure. Created for educational purposes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published