treelib - An efficient implementation of tree data structure in python 2/3.

  •        105

Tree implementation in python: simple to use for you. Brett Alistair Kromkamp ( Post basic idea online.



Related Projects

algorithms_and_data_structures - 180+ Algorithm & Data Structure Problems using C++

  •    C++

Note: Some of the code here is old and was written when I was learning C++. It might be possible that code is not safe or making wrong assumptions. Please use with caution. Pull requests are always welcome. Include contains single header implementation of data structures and some algorithms.


  •    Go

Go-datastructures is a collection of useful, performant, and threadsafe Go datastructures.Interval tree for collision in n-dimensional ranges. Implemented via a red-black augmented tree. Extra dimensions are handled in simultaneous inserts/queries to save space although this may result in suboptimal time complexity. Intersection determined using bit arrays. In a single dimension, inserts, deletes, and queries should be in O(log n) time.

Data-Structures-and-Algorithms - Data Structures and Algorithms implementation in Go

  •    Go

There are several data structures and algorithms implemented in this project. The list will be replenished with time. The library is not intended for direct use by importing. We strongly recommend copying the necessary implementations and adjusting to your case.

cosmos - Algorithms that run our universe | Your personal library of every algorithm and data structure code that you will ever encounter | Ask us anything at our forum

  •    C++

Cosmos is your personal offline collection of every algorithm and data structure one will ever encounter and use in a lifetime. This provides solutions in various languages spanning C, C++, Java, JavaScript, Swift, Python, Go and others. This work is maintained by a community of hundreds of people and is a massive collaborative effort to bring the readily available coding knowledge offline.

decisiontree - ID3-based implementation of the ML Decision Tree algorithm

  •    Ruby

A Ruby library which implements ID3 (information gain) algorithm for decision tree learning. Currently, continuous and discrete datasets can be learned.

flatbush - A very fast static spatial index for 2D points and rectangles in JavaScript

  •    Javascript

A really fast static spatial index for 2D points and rectangles in JavaScript. An efficient implementation of the packed Hilbert R-tree algorithm. Enables fast spatial queries on a very large number of objects (e.g. millions), which is very useful in maps, data visualizations and computational geometry algorithms.

nanomorph - 🚅 - Hyper fast diffing algorithm for real DOM nodes

  •    Javascript

It's common to work with lists of elements on the DOM. Adding, removing or reordering elements in a list can be rather expensive. To optimize this you can add an id attribute to a DOM node. When reordering nodes it will compare nodes with the same ID against each other, resulting in far fewer re-renders. This is especially potent when coupled with DOM node caching. Sometimes we want to tell the algorithm to not evaluate certain nodes (and its children). This can be because we're sure they haven't changed, or perhaps because another piece of code is managing that part of the DOM tree. To achieve this nanomorph evaluates the .isSameNode() method on nodes to determine if they should be updated or not.

tgboost - Tiny Gradient Boosting Tree

  •    Java

It is a Tiny implement of Gradient Boosting tree, based on XGBoost's scoring function and SLIQ's efficient tree building algorithm. TGBoost build the tree in a level-wise way as in SLIQ (by constructing Attribute list and Class list). Currently, TGBoost support parallel learning on single machine, the speed and memory consumption are comparable to XGBoost. Handle missing value, XGBoost learn a direction for those with missing value, the direction is left or right. TGBoost take a different approach: it enumerate missing value go to left child, right child and missing value child, then choose the best one. So TGBoost use Ternary Tree.

python-fp-growth - An implementation of the FP-growth algorithm in pure Python.

  •    Python

This module provides a pure Python implementation of the FP-growth algorithm for finding frequent itemsets. FP-growth exploits an (often-valid) assumption that many transactions will have items in common to build a prefix tree. If the assumption holds true, this tree produces a compact representation of the actual transactions and is used to generate itemsets much faster than Apriori can. Note that find_frequent_itemsets returns a generator of itemsets, not a greedily-populated list. Each item must be hashable (i.e., it must be valid as a member of a dictionary or a set).

cascadb - Yet another write-optimized storage engine, using buffered B-tree algorithm inspired by TokuDB

  •    C++

Yet another write-optimized storage engine, using buffered B-tree algorithm inspired by TokuDB. CascaDB can have better performance if libaio and google snappy library 're installed. Otherwise Posix AIO (simulate AIO with multiple threads which is not true asynchronous) is used instead and data blocks're not compressed.

rbush - RBush — a high-performance JavaScript R-tree-based 2D spatial index for points and rectangles

  •    Javascript

RBush is a high-performance JavaScript library for 2D spatial indexing of points and rectangles. It's based on an optimized R-tree data structure with bulk insertion support. Spatial index is a special data structure for points and rectangles that allows you to perform queries like "all items within this bounding box" very efficiently (e.g. hundreds of times faster than looping over all items). It's most commonly used in maps and data visualizations.

SwiftGraph - A Graph Data Structure in Pure Swift

  •    Swift

SwiftGraph is a pure Swift (no Cocoa) implementation of a graph data structure, appropriate for use on all platforms Swift supports (iOS, macOS, Linux, etc.). It includes support for weighted, unweighted, directed, and undirected graphs. It uses generics to abstract away both the type of the vertices, and the type of the weights. It includes copious in-source documentation, unit tests, as well as search functions for doing things like breadth-first search, depth-first search, and Dijkstra's algorithm. Further, it includes utility functions for topological sort, Jarnik's algorithm to find a minimum-spanning tree, detecting a DAG (directed-acyclic-graph), and enumerating all cycles.

Java - All Algorithms implemented in Java

  •    Java

Algorithms are implemented in Java. This is for education purpose only. Algorithms include Sorting, Search Algorithms, Dynamic Programming, Ciphers, Data Structures and few more.

Spatial Tree View


Spatial Tree View gives an attractive view of a tree structure. It uses a rather clever algorithm to lay things out as neatly as possible subject to the constraint that the size of each node on screen is approximately proportional to its actual size.

ascii_art - Real-Time ASCII Art Rendering Library

  •    C

ASCII Art is a single file C/C++ library that let you transform an input image or video frame into printable ASCII characters at real-time using a single decision tree. Real-time performance is achieved by using pixel intensity comparison inside internal nodes of the tree. For a general overview on how the algorithm works, check the bottom of the demo page.