Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hqarroum/binary-search-tree
π³ A set of idiomatic implementations of a binary-search tree in multiple languages.
https://github.com/hqarroum/binary-search-tree
algorithms-and-data-structures binary-search-tree bst-tree c cpp17 data-structures python tree-structure
Last synced: 21 days ago
JSON representation
π³ A set of idiomatic implementations of a binary-search tree in multiple languages.
- Host: GitHub
- URL: https://github.com/hqarroum/binary-search-tree
- Owner: HQarroum
- License: mit
- Created: 2022-02-10T15:39:19.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-14T23:47:16.000Z (about 2 months ago)
- Last Synced: 2024-09-15T06:45:32.493Z (about 2 months ago)
- Topics: algorithms-and-data-structures, binary-search-tree, bst-tree, c, cpp17, data-structures, python, tree-structure
- Language: C++
- Homepage:
- Size: 10.9 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# binary-search-tree
> A set of idiomatic implementations of a binary-search tree in multiple languages.Current version: **1.0.0**
## π Table of content
- [Description](#-description)
- [Implementations](#-implementations)
- [See also](#-see-also)## π° Description
This repository contains idiomatic implementations of a [Binary Search Tree](https://en.wikipedia.org/wiki/Binary_search_tree) in multiple programming languages. The purpose of this repository is purely educational and aims to introduce a binary search tree recursive data structure, as well as its many implementation details across multiple languages.
A binary search tree is a tree data structure that can store arbitrarily typed data by enforcing the following properties :
- The left subtree of a node contains only nodes with keys lesser than the nodeβs key.
- The right subtree of a node contains only nodes with keys greater than the nodeβs key.
- The left and right subtree each must also be a binary search tree.
- It doesn't have any duplicate nodes.A binary search tree supports operations like `search`, `insertion`, `deletion`, `min-max search`, in $O(h)$ time where $h$ is the height of the tree. In a fully balanced binary search tree, the complexity of these operations tends to $O(\log{}n)$, where $n$ is the number of nodes in the tree. In the worst case scenario of a fully unbalanced tree, the complexity tends to $O(n)$.
> Below is an example of the structural organization of elements in a binary search tree.
## βοΈ Implementations
This repository contains implementations in the following languages.
> Click to access a particular implementation π.
Python
Typescript
C
C++
Kotlin
## π See also
- The [Binary Search Tree](https://en.wikipedia.org/wiki/Binary_search_tree) Wiki page.
- [Convert](https://www.geeksforgeeks.org/convert-normal-bst-balanced-bst/) a Binary Search Tree into a balanced tree.